From f4735b46662d622cf6c51410d5a0d0f71f253308 Mon Sep 17 00:00:00 2001 From: "SAMBA\\bernat" Date: Mon, 19 Feb 2018 09:42:40 +0100 Subject: [PATCH 1/9] update fixtures Botanical --- services/db/04-fixtures.sql | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/services/db/04-fixtures.sql b/services/db/04-fixtures.sql index 920a1dff2..a6ba07288 100644 --- a/services/db/04-fixtures.sql +++ b/services/db/04-fixtures.sql @@ -330,7 +330,7 @@ INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `life`,`workerFk (1, 'CRI', 'Crisantemo', 2, 15, 5), (2, 'ITG', 'Anthurium', 1, 30, 5), (3, 'WPN', 'Paniculata', 2, 30, 5); - + INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`) VALUES ('YEL', 'Yellow', 1 , 1), @@ -395,6 +395,26 @@ INSERT INTO `vn`.`itemPlacement`(`itemFk`, `warehouseFk`, `code`) (1, 3, 'A3'), (2, 1, 'A4'); +INSERT INTO `edi`.`genus`(`genus_id`, `latin_genus_name`, `entry_date`, `expiry_date`, `change_date_time`) + VALUES + ( 1, 'Abelia' , CURDATE(), NULL, CURDATE()), + ( 2, 'Abies', CURDATE(), NULL, CURDATE()), + ( 3, 'Abutilon', CURDATE(), NULL, CURDATE()); + +INSERT INTO `edi`.`specie`(`specie_id`, `genus_id`, `latin_species_name`, `entry_date`, `expiry_date`, `change_date_time`) + VALUES + ( 1, 1, 'grandiflora', CURDATE(), NULL, CURDATE()), + ( 2, 2, 'procera', CURDATE(), NULL, CURDATE()), + ( 3, 3, 'decurrens', CURDATE(), NULL, CURDATE()), + ( 4, 3, 'dealbata', CURDATE(), NULL, CURDATE()); + +INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`) + VALUES + ( 1, 'Hedera helix' , 1, 1), + ( 2, NULL, 2, 2), + ( 3, 'Cycas revoluta', 2, NULL), + ( 4, 'Polygonum', NULL, NULL); + INSERT INTO `salix`.`user`(`id`,`username`,`password`,`email`) VALUES (10, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 'JessicaJones@verdnatura.es'); From dcf5bf61dabae68a94d167bb95a25f768ae6ede1 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 19 Feb 2018 11:55:45 +0100 Subject: [PATCH 2/9] backend unit test for barcode duplicity plus e2e path completed --- client/item/src/barcode/item-barcode.html | 50 ++++++++--------- e2e/helpers/selectors.js | 10 +++- .../06_create_item_barcode.spec.js | 56 ++++++++++++++----- .../item/specs/crudItemBarcodes.spec.js | 21 +++++++ services/item/common/models/itemBarcode.json | 46 +++++++-------- 5 files changed, 121 insertions(+), 62 deletions(-) diff --git a/client/item/src/barcode/item-barcode.html b/client/item/src/barcode/item-barcode.html index 94b5e946a..985d3a02b 100644 --- a/client/item/src/barcode/item-barcode.html +++ b/client/item/src/barcode/item-barcode.html @@ -1,31 +1,31 @@
- - Item Barcodes - - - - - - - - - - + + Item Barcodes + + + + + + + + + + diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 38d312ffb..98035d8c2 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -145,8 +145,16 @@ export default { searchItemInput: `${components.vnTextfield}`, searchButton: `${components.vnSearchBar} > vn-icon-button > button` }, + itemBasicData: { + basicDataButton: `${components.vnMenuItem}[ui-sref="item.card.data"]` + }, itemBarcodes: { - barcodeButton: `${components.vnMenuItem}[ui-sref="item.card.itemBarcode"]` + barcodeButton: `${components.vnMenuItem}[ui-sref="item.card.itemBarcode"]`, + addBarcodeButton: `${components.vnIcon}[icon="add_circle"]`, + thirdCodeInput: `vn-horizontal:nth-child(5) > ${components.vnTextfield}`, + fourthCodeInput: `vn-horizontal:nth-child(6) > ${components.vnTextfield}`, + submitBarcodesButton: `${components.vnSubmit}`, + firstCodeRemoveButton: `vn-horizontal:nth-child(3) > vn-one > ${components.vnIcon}[icon="remove_circle_outline"]` } }; diff --git a/e2e/paths/item-module/06_create_item_barcode.spec.js b/e2e/paths/item-module/06_create_item_barcode.spec.js index af0a2bce2..9d4134672 100644 --- a/e2e/paths/item-module/06_create_item_barcode.spec.js +++ b/e2e/paths/item-module/06_create_item_barcode.spec.js @@ -55,17 +55,47 @@ describe('create item barcodes path', () => { .catch(catchErrors(done)); }); - // it(`should click on the search result to access to the item barcodes`, done => { - // nightmare - // .waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time') - // .waitToClick(selectors.itemsIndex.searchResult) - // .waitToClick(selectors.itemBarcodes.barcodeButton) - // .waitForURL('barcode') - // .url() - // .then(url => { - // expect(url).toContain('barcode'); - // done(); - // }) - // .catch(catchErrors(done)); - // }); + it(`should click on the search result to access to the item barcodes`, done => { + nightmare + .waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time') + .waitToClick(selectors.itemsIndex.searchResult) + .waitToClick(selectors.itemBarcodes.barcodeButton) + .waitForURL('barcode') + .url() + .then(url => { + expect(url).toContain('barcode'); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should click create a new code and delete a former one`, done => { + nightmare + .waitToClick(selectors.itemBarcodes.addBarcodeButton) + .type(selectors.itemBarcodes.fourthCodeInput, '5') + .click(selectors.itemBarcodes.firstCodeRemoveButton) + .click(selectors.itemBarcodes.submitBarcodesButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toContain('Data saved!'); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, done => { + nightmare + .waitForSnackbarReset() + .click(selectors.itemBasicData.basicDataButton) + .wait(selectors.itemBasicData.nameInput) + .click(selectors.itemBarcodes.barcodeButton) + .wait(200) + .getInputValue(selectors.itemBarcodes.thirdCodeInput) + .then(result => { + expect(result).toEqual('5'); + done(); + }) + .catch(catchErrors(done)); + }); }); diff --git a/services/item/common/methods/item/specs/crudItemBarcodes.spec.js b/services/item/common/methods/item/specs/crudItemBarcodes.spec.js index 72365229a..d560677d9 100644 --- a/services/item/common/methods/item/specs/crudItemBarcodes.spec.js +++ b/services/item/common/methods/item/specs/crudItemBarcodes.spec.js @@ -1,7 +1,19 @@ const crudItemBarcodes = require('../crudItemBarcodes'); const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors; +let mysql = require('mysql2'); describe('Item crudItemBarcodes()', () => { + let connection; + beforeAll(() => { + connection = mysql.createConnection({ + multipleStatements: true, + host: 'localhost', + user: 'root', + password: '', + database: 'salix' + }); + }); + it('should call the destroyAll methodif there are ids in delete Array', done => { let self = jasmine.createSpyObj('self', ['remoteMethod', 'crudItemBarcodes', 'destroyAll', 'create', 'upsert']); @@ -48,4 +60,13 @@ describe('Item crudItemBarcodes()', () => { }) .catch(catchErrors(done)); }); + + it('should return an error when attempting to save a duplicated barcode', done => { + let callback = (err, res) => { + expect(err.toString()).toBe("Error: Duplicate entry '4' for key 'PRIMARY'"); + done(); + }; + + connection.query('INSERT INTO `vn`.`itemBarcode` VALUES (4, 2 ,4 );', callback); + }); }); diff --git a/services/item/common/models/itemBarcode.json b/services/item/common/models/itemBarcode.json index 9274cae98..8c089609f 100644 --- a/services/item/common/models/itemBarcode.json +++ b/services/item/common/models/itemBarcode.json @@ -1,28 +1,28 @@ { - "name": "ItemBarcode", - "base": "VnModel", - "options": { - "mysql": { - "table": "itemBarcode", - "database": "vn" - } - }, - "properties": { - "id": { - "type": "Number", - "id": true, - "description": "Identifier" - }, - "code": { - "type": "String", - "required": true + "name": "ItemBarcode", + "base": "VnModel", + "options": { + "mysql": { + "table": "itemBarcode", + "database": "vn" } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" }, - "relations": { - "item": { - "type": "belongsTo", - "model": "Item", - "foreignKey": "itemFk" - } + "code": { + "type": "String", + "required": true } + }, + "relations": { + "item": { + "type": "belongsTo", + "model": "Item", + "foreignKey": "itemFk" + } } +} From 84bc50593741dbb57ec71a56a1cc471b88736ce4 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 19 Feb 2018 11:58:02 +0100 Subject: [PATCH 3/9] adapted test to show now 6 sales person --- .../common/methods/client/specs/activeSalesperson.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/loopback/common/methods/client/specs/activeSalesperson.spec.js b/services/loopback/common/methods/client/specs/activeSalesperson.spec.js index 085c0f3ce..80c47db24 100644 --- a/services/loopback/common/methods/client/specs/activeSalesperson.spec.js +++ b/services/loopback/common/methods/client/specs/activeSalesperson.spec.js @@ -17,14 +17,14 @@ describe('Client activeSalesPerson', () => { app.models.Client.activeSalesPerson(filter, callback); }); - it('should call the activeSalesPerson() method with no limit and receive all 3 salesPersons', done => { + it('should call the activeSalesPerson() method with no limit and receive all 6 salesPersons', done => { let filter = { }; let callback = (error, result) => { if (error) return catchErrors(done)(error); - expect(result.length).toEqual(3); + expect(result.length).toEqual(6); done(); }; From 3018898cad4943c05357ca0976a4b3fe6a684263 Mon Sep 17 00:00:00 2001 From: "SAMBA\\bernat" Date: Mon, 19 Feb 2018 12:50:14 +0100 Subject: [PATCH 4/9] update fixtures / alter table vn2008.articles_nicho --- services/db/04-fixtures.sql | 9 ++++----- services/db/changes/1.0.0/05-articles_nicho.sql | 13 +++++++++++++ services/db/changes/1.0.0/06-itemPlacement.sql | 12 ++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 services/db/changes/1.0.0/05-articles_nicho.sql create mode 100644 services/db/changes/1.0.0/06-itemPlacement.sql diff --git a/services/db/04-fixtures.sql b/services/db/04-fixtures.sql index a6ba07288..e4726c0ef 100644 --- a/services/db/04-fixtures.sql +++ b/services/db/04-fixtures.sql @@ -247,7 +247,6 @@ INSERT INTO `vn2008`.`empresa`(`id`, `abbreviation`, `registro`, `gerente_id`, ` VALUES (442, 'WAY', 'Wayne Industries, Inc. operates as a warehouse for steel products.', '2', '1989-11-19', NULL, NULL, '1', '1', '00FF00', 'BruceWayne@verdnatura.es', NULL, '1989-08-11 12:31:22', '10', '1', NULL, '1', '1'); - INSERT INTO `vn`.`ticket`(`id`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `clientFk`,`nickname`, `addressFk`) VALUES (1, 1, 1, NULL, CURDATE(), 1, 'Batman', 101), @@ -390,10 +389,10 @@ INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`) INSERT INTO `vn`.`itemPlacement`(`itemFk`, `warehouseFk`, `code`) VALUES - (1, 1, 'A1'), - (1, 2, 'A2'), - (1, 3, 'A3'), - (2, 1, 'A4'); + ( 1, 1, 'A1'), + ( 1, 2, 'A2'), + ( 1, 3, 'A3'), + ( 2, 1, 'A4'); INSERT INTO `edi`.`genus`(`genus_id`, `latin_genus_name`, `entry_date`, `expiry_date`, `change_date_time`) VALUES diff --git a/services/db/changes/1.0.0/05-articles_nicho.sql b/services/db/changes/1.0.0/05-articles_nicho.sql new file mode 100644 index 000000000..ec0c2397b --- /dev/null +++ b/services/db/changes/1.0.0/05-articles_nicho.sql @@ -0,0 +1,13 @@ +ALTER TABLE `vn2008`.`Articles_nicho` +DROP FOREIGN KEY `Articles_nichos_fk`; +ALTER TABLE `vn2008`.`Articles_nicho` +CHANGE COLUMN `Id_Article` `Id_Article` INT(11) NOT NULL , +ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT AFTER `modificationDate`, +DROP PRIMARY KEY, +ADD PRIMARY KEY (`id`); +ALTER TABLE `vn2008`.`Articles_nicho` +ADD CONSTRAINT `Articles_nichos_fk` + FOREIGN KEY (`Id_Article`) + REFERENCES `vn2008`.`Articles` (`Id_Article`) + ON DELETE CASCADE + ON UPDATE CASCADE; diff --git a/services/db/changes/1.0.0/06-itemPlacement.sql b/services/db/changes/1.0.0/06-itemPlacement.sql new file mode 100644 index 000000000..ad24ab291 --- /dev/null +++ b/services/db/changes/1.0.0/06-itemPlacement.sql @@ -0,0 +1,12 @@ +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `root`@`%` + SQL SECURITY DEFINER +VIEW `vn`.`itemPlacement` AS + SELECT + `an`.`id` AS `id`, + `an`.`Id_Article` AS `itemFk`, + `an`.`warehouse_id` AS `warehouseFk`, + `an`.`nicho` AS `code` + FROM + `vn2008`.`Articles_nicho` `an`; From 171d0f5867cc1a8e0d1c3698dd359c10005d952e Mon Sep 17 00:00:00 2001 From: "SAMBA\\bernat" Date: Mon, 19 Feb 2018 13:21:15 +0100 Subject: [PATCH 5/9] update changes05-articles_nicho --- services/db/changes/1.0.0/05-articles_nicho.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/db/changes/1.0.0/05-articles_nicho.sql b/services/db/changes/1.0.0/05-articles_nicho.sql index ec0c2397b..8609181ea 100644 --- a/services/db/changes/1.0.0/05-articles_nicho.sql +++ b/services/db/changes/1.0.0/05-articles_nicho.sql @@ -11,3 +11,6 @@ ADD CONSTRAINT `Articles_nichos_fk` REFERENCES `vn2008`.`Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE; + + + From 20229cf3e19a4da6bee49343559ca52a44c11ce5 Mon Sep 17 00:00:00 2001 From: "SAMBA\\bernat" Date: Mon, 19 Feb 2018 13:39:31 +0100 Subject: [PATCH 6/9] update fixtures --- services/db/04-fixtures.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/db/04-fixtures.sql b/services/db/04-fixtures.sql index e4726c0ef..5ccd1b5e3 100644 --- a/services/db/04-fixtures.sql +++ b/services/db/04-fixtures.sql @@ -387,12 +387,12 @@ INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`) (3, 1 ,3 ), (4, 2 ,4 ); -INSERT INTO `vn`.`itemPlacement`(`itemFk`, `warehouseFk`, `code`) +INSERT INTO `vn`.`itemPlacement`(`id`, `itemFk`, `warehouseFk`, `code`) VALUES - ( 1, 1, 'A1'), - ( 1, 2, 'A2'), - ( 1, 3, 'A3'), - ( 2, 1, 'A4'); + (1, 1, 1, 'A1'), + (2, 1, 2, 'A2'), + (3, 1, 3, 'A3'), + (4, 2, 1, 'A4'); INSERT INTO `edi`.`genus`(`genus_id`, `latin_genus_name`, `entry_date`, `expiry_date`, `change_date_time`) VALUES From 9e4d03ecf3df6d9c6c9a19903d54a3c4ebe2b32e Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 19 Feb 2018 20:50:01 +0100 Subject: [PATCH 7/9] electron now closes after each e2e path completed. --- e2e/paths/client-module/01_create_client.spec.js | 8 ++++++++ e2e/paths/client-module/02_edit_basic_data.spec.js | 8 ++++++++ e2e/paths/client-module/03_edit_fiscal_data.spec.js | 8 ++++++++ e2e/paths/client-module/04_edit_pay_method.spec.js | 8 ++++++++ e2e/paths/client-module/05_add_address.spec.js | 8 ++++++++ e2e/paths/client-module/06_add_address_notes.spec.js | 8 ++++++++ e2e/paths/client-module/07_edit_web_access.spec.js | 8 ++++++++ e2e/paths/client-module/08_add_notes.spec.js | 8 ++++++++ e2e/paths/client-module/09_add_credit.spec.js | 8 ++++++++ e2e/paths/client-module/10_add_greuge.spec.js | 8 ++++++++ e2e/paths/client-module/11_mandate.spec.js | 8 ++++++++ e2e/paths/item-module/06_create_item_barcode.spec.js | 8 ++++++++ 12 files changed, 96 insertions(+) diff --git a/e2e/paths/client-module/01_create_client.spec.js b/e2e/paths/client-module/01_create_client.spec.js index f8a32a1fa..474391ec5 100644 --- a/e2e/paths/client-module/01_create_client.spec.js +++ b/e2e/paths/client-module/01_create_client.spec.js @@ -230,4 +230,12 @@ describe('create client path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/02_edit_basic_data.spec.js b/e2e/paths/client-module/02_edit_basic_data.spec.js index 1a9649844..3097a9663 100644 --- a/e2e/paths/client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/client-module/02_edit_basic_data.spec.js @@ -279,4 +279,12 @@ describe('Edit basicData path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/03_edit_fiscal_data.spec.js b/e2e/paths/client-module/03_edit_fiscal_data.spec.js index b3b4d416e..809683de8 100644 --- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js @@ -563,4 +563,12 @@ describe('Edit fiscalData path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/04_edit_pay_method.spec.js b/e2e/paths/client-module/04_edit_pay_method.spec.js index c03934e87..e6c040f0a 100644 --- a/e2e/paths/client-module/04_edit_pay_method.spec.js +++ b/e2e/paths/client-module/04_edit_pay_method.spec.js @@ -267,4 +267,12 @@ describe('Edit pay method path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/05_add_address.spec.js b/e2e/paths/client-module/05_add_address.spec.js index d90f7d775..4a6dcc421 100644 --- a/e2e/paths/client-module/05_add_address.spec.js +++ b/e2e/paths/client-module/05_add_address.spec.js @@ -285,4 +285,12 @@ describe('Add address path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/06_add_address_notes.spec.js b/e2e/paths/client-module/06_add_address_notes.spec.js index dae6b4817..eecf3d356 100644 --- a/e2e/paths/client-module/06_add_address_notes.spec.js +++ b/e2e/paths/client-module/06_add_address_notes.spec.js @@ -96,4 +96,12 @@ describe('Add address notes path', () => { // }) // .catch(catchErrors(done)); // }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/07_edit_web_access.spec.js b/e2e/paths/client-module/07_edit_web_access.spec.js index 10619ebcf..e3cc4fada 100644 --- a/e2e/paths/client-module/07_edit_web_access.spec.js +++ b/e2e/paths/client-module/07_edit_web_access.spec.js @@ -131,4 +131,12 @@ describe('Edit web access path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/08_add_notes.spec.js b/e2e/paths/client-module/08_add_notes.spec.js index 1e78f3a1f..6e8b59c03 100644 --- a/e2e/paths/client-module/08_add_notes.spec.js +++ b/e2e/paths/client-module/08_add_notes.spec.js @@ -107,4 +107,12 @@ describe('Add notes path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/09_add_credit.spec.js b/e2e/paths/client-module/09_add_credit.spec.js index 4608755ce..0a180e928 100644 --- a/e2e/paths/client-module/09_add_credit.spec.js +++ b/e2e/paths/client-module/09_add_credit.spec.js @@ -108,4 +108,12 @@ describe('Add credit path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/10_add_greuge.spec.js b/e2e/paths/client-module/10_add_greuge.spec.js index 5e35e5801..d3b43a868 100644 --- a/e2e/paths/client-module/10_add_greuge.spec.js +++ b/e2e/paths/client-module/10_add_greuge.spec.js @@ -165,4 +165,12 @@ describe('Add greuge path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/client-module/11_mandate.spec.js b/e2e/paths/client-module/11_mandate.spec.js index c0e535535..ab18d5bb2 100644 --- a/e2e/paths/client-module/11_mandate.spec.js +++ b/e2e/paths/client-module/11_mandate.spec.js @@ -83,4 +83,12 @@ describe('mandate path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); diff --git a/e2e/paths/item-module/06_create_item_barcode.spec.js b/e2e/paths/item-module/06_create_item_barcode.spec.js index 9d4134672..d0426f098 100644 --- a/e2e/paths/item-module/06_create_item_barcode.spec.js +++ b/e2e/paths/item-module/06_create_item_barcode.spec.js @@ -98,4 +98,12 @@ describe('create item barcodes path', () => { }) .catch(catchErrors(done)); }); + + describe('closing browser', () => { + it('should close the browser', done => { + nightmare + .end() + .then(done); + }); + }); }); From feabfc05d6ed6def8da86d389fba731d65f803f2 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 19 Feb 2018 20:52:07 +0100 Subject: [PATCH 8/9] html indent refactors --- .../client/src/address-edit/address-edit.html | 6 +++--- .../components/autocomplete/autocomplete.html | 8 +++---- client/item/src/data/item-data.html | 21 +++++++------------ 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/client/client/src/address-edit/address-edit.html b/client/client/src/address-edit/address-edit.html index 357f58897..42b73ecdb 100644 --- a/client/client/src/address-edit/address-edit.html +++ b/client/client/src/address-edit/address-edit.html @@ -58,7 +58,7 @@ show-field = "description" label = "Observation type" order = "description ASC" - filter-search="{where: {description: {regexp: 'search'}} }"> + filter-search="{where: {description: {regexp: 'search'}}}"> {{$parent.$parent.item.description}} @@ -75,8 +75,8 @@ orange icon="add_circle" ng-if = "observation.showAddIcon && observationsTypes.model.length > $ctrl.observations.length" - ng-click="$ctrl.addObservation()" - > + ng-click="$ctrl.addObservation()"> + diff --git a/client/core/src/components/autocomplete/autocomplete.html b/client/core/src/components/autocomplete/autocomplete.html index df78db6d9..6dd9b3ab7 100644 --- a/client/core/src/components/autocomplete/autocomplete.html +++ b/client/core/src/components/autocomplete/autocomplete.html @@ -3,8 +3,7 @@ label="{{$ctrl.label}}" model="$ctrl.displayValue" readonly="$ctrl.readonly" - tab-index="-1" - > + tab-index="-1"> {{$parent.item[$ctrl.showField]}} + parent = "$ctrl.element"> + {{$parent.item[$ctrl.showField]}} + \ No newline at end of file diff --git a/client/item/src/data/item-data.html b/client/item/src/data/item-data.html index 35066b200..608be09e7 100644 --- a/client/item/src/data/item-data.html +++ b/client/item/src/data/item-data.html @@ -1,9 +1,7 @@ - + override="{filter: {include: [{relation: 'itemType'}, {relation: 'origin'}, {relation: 'ink'}, {relation: 'producer'}, {relation: 'expence'}]}}"> + initial-data="$ctrl.item.itemType"> @@ -36,14 +33,11 @@ field="$ctrl.item.intrastatFk" order="description ASC" filter-search="{where: {description: {regexp: 'search'}} }" - initial-data="$ctrl.item.intrastat" - > + initial-data="$ctrl.item.intrastat"> {{$parent.$parent.item.description}} - - + initial-data="$ctrl.item.origin"> + + initial-data="$ctrl.item.expence"> + @@ -66,4 +60,3 @@
- From a3985e70ed5b5363ceac458e8db9ead16573b5ee Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Tue, 20 Feb 2018 08:53:06 +0100 Subject: [PATCH 9/9] Tarea #37 ItemBotanical --- client/item/src/botanical/item-botanical.html | 46 +++++++++++++++++-- client/item/src/botanical/item-botanical.js | 27 ++++++++++- 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/client/item/src/botanical/item-botanical.html b/client/item/src/botanical/item-botanical.html index 36cd49f8f..de6b31787 100644 --- a/client/item/src/botanical/item-botanical.html +++ b/client/item/src/botanical/item-botanical.html @@ -1,5 +1,41 @@ - - - Botanical - - \ No newline at end of file + + + + +
+ + + Botanical + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/client/item/src/botanical/item-botanical.js b/client/item/src/botanical/item-botanical.js index 8bd744e53..03020648b 100644 --- a/client/item/src/botanical/item-botanical.js +++ b/client/item/src/botanical/item-botanical.js @@ -1,5 +1,30 @@ import ngModule from '../module'; +class ItemBotanical { + constructor($http, $state) { + this.$http = $http; + this.botanical = { + itemFk: $state.params.id + }; + } + $onInit() { + let filter = { + where: { + itemFk: this.botanical.itemFk + }, + include: [{relation: 'genus'}, {relation: 'specie'}] + }; + this.$http.get(`/item/api/ItemBotanicals?filter=${JSON.stringify(filter)}`) + .then(res => { + if (res.data) { + Object.assign(this.botanical, res.data); + } + }); + } +} +ItemBotanical.$inject = ['$http', '$state']; + ngModule.component('vnItemBotanical', { - template: require('./item-botanical.html') + template: require('./item-botanical.html'), + controller: ItemBotanical });