Skip to content

Instantly share code, notes, and snippets.

View LucasBadico's full-sized avatar

Lucas Badico LucasBadico

View GitHub Profile
@LucasBadico
LucasBadico / garage-service.spec.js
Last active October 14, 2019 19:32
create method
import { GarageRepo, GarageService } from '../../src';
describe('Garage Service test', () => {
it('should GarageService be defined', () => {
expect(GarageService).toBeDefined();
});
describe('methods', () => {
@LucasBadico
LucasBadico / garage.feature
Last active October 14, 2019 19:23
garage service bdd
Esquema do Cenário: Cadastro da oficina
Dado que estou na tela para cadastrar uma oficina
Quando informo os seguintes dados:
| nome | Della Via - Ipiranga |
| cep | 04278000 |
| num | 664 |
| credenciado | <credenciado> |
E clico no botão salvar
Então eu devo ver a mensagem de sucesso "Oficina cadastrada com sucesso"
E o endereço deve estar cadastrado no banco de dados com todas as informações e o status deve ser "ACTIVE"
@LucasBadico
LucasBadico / index.js
Created October 14, 2019 19:11
index
export { default as GarageService } from './lib/garage-service';
export { default as GarageRepo } from './lib/garage-repo';
export default class GarageRepo {
constructor(mysql, redis) {
this.mysql = mysql;
this.redis = redis;
}
}
import { GarageRepo, GarageService } from '../../src';
describe('Garage Service test', () => {
it('should GarageService be defined', () => {
expect(GarageService).toBeDefined();
});
})
@LucasBadico
LucasBadico / backoffice-header.js
Created October 1, 2019 17:29
webcomponent sample
import { LitElement, html } from 'lit-element';
class BackofficeHeader extends LitElement {
static get properties() {
return {
title: String,
subtitle: String,
};
}
render(){
import React from 'react';
export class BackofficeHeader extends React.Component {
render() {
const {props} = this
return <div>
<h1>{props.title}</h1>
<p class="subtitle"> {props.subtilte || ''} </p>
{props.children}
@LucasBadico
LucasBadico / backoffice-header.vue
Last active October 1, 2019 17:16
vue component
<script>
export default {
name: "backoffice-header",
props: { title: { type: String, required: true }, subtitle: { type: String, required: false, default: '' } }
}
</script>
<template>
<h1> {{title}}</h1>
<p class="subtitle"> {{subtitle}}</p>
<slot></slot>
@LucasBadico
LucasBadico / backoffice-header.js
Last active October 1, 2019 16:57
backoffice-header.react16.js
import React from 'react';
export function BackofficeHeader(props) {
return <div>
<h1>{props.title}</h1>
<p class="subtitle"> {props.subtilte || ''} </p>
{props.children}
</div>
}
@LucasBadico
LucasBadico / CombineShape.js
Created June 19, 2018 15:08
Combine of composer
// essa funcao receber n numeros of shapes
// cada shape com posicao e seu centro
// e devolvera um array bidimencional
const dot = [
[1]
]
const square = [
[1, 1 ],
[1, 1],