This commit is contained in:
Vicente Falco 2018-02-08 07:57:28 +01:00
commit b719a1615d
2 changed files with 31 additions and 2 deletions

View File

@ -23,8 +23,37 @@ describe('Client', () => {
expect(controller.address.id).toEqual(1); expect(controller.address.id).toEqual(1);
}); });
describe('_setIconAdd()', () => {
it('should set the propertie sowAddIcon from all observations to false less last one that be true', () => {
controller.observations = [
{id: 1, description: 'Spiderman rocks', showAddIcon: true},
{id: 2, description: 'Batman sucks', showAddIcon: true},
{id: 3, description: 'Ironman rules', showAddIcon: false}
];
controller._setIconAdd();
expect(controller.observations[0].showAddIcon).toBeFalsy();
expect(controller.observations[1].showAddIcon).toBeFalsy();
expect(controller.observations[2].showAddIcon).toBeTruthy();
});
});
describe('addObservation()', () => {
it('should add one empty observation into controller observations collection and call _setIconAdd()', () => {
controller.observations = [];
spyOn(controller, '_setIconAdd').and.callThrough();
controller.addObservation();
expect(controller._setIconAdd).toHaveBeenCalledWith();
expect(controller.observations.length).toEqual(1);
expect(controller.observations[0].id).toBe(undefined);
expect(controller.observations[0].showAddIcon).toBeTruthy();
});
});
describe('removeObservation(index)', () => { describe('removeObservation(index)', () => {
it('should remove an observation that occupies in the index given and restore showAddIcon properties', () => { it('should remove an observation that occupies the position in the index given and call _setIconAdd()', () => {
let index = 2; let index = 2;
controller.observations = [ controller.observations = [
{id: 1, description: 'Spiderman rocks', showAddIcon: false}, {id: 1, description: 'Spiderman rocks', showAddIcon: false},

View File

@ -135,7 +135,7 @@ gulp.task('docker-compose', async () => {
context: `./services`, context: `./services`,
dockerfile: dockerFile dockerfile: dockerFile
}, },
ports: [`${defaultPort}:${service.port}`] ports: [`${service.port}:${defaultPort}`]
}; };
composeYml.services.nginx.links.push( composeYml.services.nginx.links.push(
`${service.name}:\${BRANCH_NAME}-${service.name}` `${service.name}:\${BRANCH_NAME}-${service.name}`