diff --git a/back/models/company.json b/back/models/company.json index d3700bad6..86965d829 100644 --- a/back/models/company.json +++ b/back/models/company.json @@ -3,18 +3,21 @@ "description": "Companies", "base": "VnModel", "options": { - "mysql": { - "table": "company" - } + "mysql": { + "table": "company" + } }, "properties": { - "id": { - "id": true, - "type": "Number", - "description": "Identifier" - }, - "code": { - "type": "String" - } + "id": { + "id": true, + "type": "Number", + "description": "Identifier" + }, + "code": { + "type": "String" + }, + "expired": { + "type": "date" + } } - } \ No newline at end of file +} \ No newline at end of file diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 3216e76a8..0094dca9a 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -493,4 +493,10 @@ export default { observationInput: `vn-textarea[label="Observation"] textarea`, saveButton: `${components.vnSubmit}` }, + orderLine: { + orderSubtotal: 'vn-order-line > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > div > span', + firstLineDeleteButton: 'vn-order-line vn-tbody > vn-tr:nth-child(1) vn-icon[icon="delete"]', + confirmOrder: 'vn-order-line > vn-vertical > vn-button-bar > vn-button > button', + confirmButton: 'vn-order-line > vn-confirm button[response="ACCEPT"]', + }, }; diff --git a/e2e/paths/order-module/02_lines.spec.js b/e2e/paths/order-module/02_lines.spec.js new file mode 100644 index 000000000..b7d28d2f4 --- /dev/null +++ b/e2e/paths/order-module/02_lines.spec.js @@ -0,0 +1,45 @@ +import selectors from '../../helpers/selectors.js'; +import createNightmare from '../../helpers/nightmare'; + +describe('Order lines', () => { + const nightmare = createNightmare(); + beforeAll(() => { + nightmare + .loginAndModule('employee', 'order') + .accessToSearchResult('16') + .accessToSection('order.card.line'); + }); + + it('should check the order subtotal', async() => { + const result = await nightmare + .waitToGetProperty(selectors.orderLine.orderSubtotal, 'innerText'); + + expect(result).toContain('135.60'); + }); + + it('should delete the first line in the order', async() => { + const result = await nightmare + .waitToClick(selectors.orderLine.firstLineDeleteButton) + .waitToClick(selectors.orderLine.confirmButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + + it('should confirm the order subtotal has changed', async() => { + const result = await nightmare + .waitToGetProperty(selectors.orderLine.orderSubtotal, 'innerText'); + + expect(result).toContain('90.10'); + }); + + it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => { + const url = await nightmare + .waitToClick(selectors.orderLine.confirmOrder) + .waitForURL('ticket/index') + .parsedUrl(); + + expect(url.hash).toContain('ticket/index'); + expect(url.hash).toContain('clientFk'); + }); +}); diff --git a/e2e/paths/ticket-module/07_edit_sale.spec.js b/e2e/paths/ticket-module/07_edit_sale.spec.js index c4fe61ab0..09cce2836 100644 --- a/e2e/paths/ticket-module/07_edit_sale.spec.js +++ b/e2e/paths/ticket-module/07_edit_sale.spec.js @@ -296,7 +296,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(`The sales of this ticket can't be modified`); }); - it('should transfer the sale to a valid ticket', async() => { + it('should transfer the third sale to a valid ticket', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.moveToTicketInputClearButton) .write(selectors.ticketSales.moveToTicketInput, 12) @@ -357,7 +357,7 @@ describe('Ticket Edit sale path', () => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) - .write(selectors.ticketSales.moveToTicketInput, 16) + .write(selectors.ticketSales.moveToTicketInput, '16') .waitToClick(selectors.ticketSales.moveToTicketButton) .waitForURL('ticket/16/sale') .parsedUrl(); @@ -367,7 +367,7 @@ describe('Ticket Edit sale path', () => { it('should confirm the original ticket received the line', async() => { const result = await nightmare - .wait(selectors.ticketSales.saleLine) + // .waitForNumberOfElements(selectors.ticketSales.saleLine, 3) .countElement(selectors.ticketSales.saleLine); expect(result).toEqual(3); diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html index e3a42f346..28d35efcd 100644 --- a/modules/agency/front/descriptor/index.html +++ b/modules/agency/front/descriptor/index.html @@ -3,7 +3,9 @@ - + + +
- +
@@ -40,7 +42,7 @@ - +
{ }); }); - fdescribe('showDeliveryNote()', () => { + describe('showDeliveryNote()', () => { it('should open a new window showing a delivery note PDF document', () => { let expectedPath = '/api/report/rpt-delivery-note?ticketFk=2'; spyOn(window, 'open'); diff --git a/modules/ticket/back/models/ticket-request.json b/modules/ticket/back/models/ticket-request.json index 8a01752bf..2ec916d69 100644 --- a/modules/ticket/back/models/ticket-request.json +++ b/modules/ticket/back/models/ticket-request.json @@ -32,6 +32,9 @@ "atenderFk": { "type": "Number", "required": true + }, + "response": { + "type": "String" } }, "relations": { @@ -54,6 +57,11 @@ "type": "belongsTo", "model": "Worker", "foreignKey": "requesterFk" + }, + "item": { + "type": "belongsTo", + "model": "Item", + "foreignKey": "itemFk" } } } \ No newline at end of file diff --git a/modules/ticket/front/services/index.html b/modules/ticket/front/services/index.html index 797a8ace6..e5201cd44 100644 --- a/modules/ticket/front/services/index.html +++ b/modules/ticket/front/services/index.html @@ -51,7 +51,7 @@ - - -
-
Firma digital
-
- -
{{signature.created | date}}
+
+
+
Firma digital
+
+ +
{{signature.created | date}}
+
+
+