From 4ea65cdf8011ea2ed36dbd2c5ff6c042323f2da0 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Thu, 8 Feb 2018 07:51:24 +0100 Subject: [PATCH 1/2] gulp nginx --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 5d5f5c8c0..6950cfcf9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -135,7 +135,7 @@ gulp.task('docker-compose', async () => { context: `./services`, dockerfile: dockerFile }, - ports: [`${defaultPort}:${service.port}`] + ports: [`${service.port}:${defaultPort}`] }; composeYml.services.nginx.links.push( `${service.name}:\${BRANCH_NAME}-${service.name}` From a83bae465f1173d600d56652bf07d84b170d9c2b Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Thu, 8 Feb 2018 07:54:20 +0100 Subject: [PATCH 2/2] new tests added into address-edit --- .../src/address-edit/address-edit.spec.js | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/client/client/src/address-edit/address-edit.spec.js b/client/client/src/address-edit/address-edit.spec.js index 5c41d653c..727772d7e 100644 --- a/client/client/src/address-edit/address-edit.spec.js +++ b/client/client/src/address-edit/address-edit.spec.js @@ -23,8 +23,37 @@ describe('Client', () => { 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)', () => { - 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; controller.observations = [ {id: 1, description: 'Spiderman rocks', showAddIcon: false},