diff --git a/src/pages/Customer/components/CustomerAddressCreate.vue b/src/pages/Customer/components/CustomerAddressCreate.vue index 32b4078db..ea820a3a5 100644 --- a/src/pages/Customer/components/CustomerAddressCreate.vue +++ b/src/pages/Customer/components/CustomerAddressCreate.vue @@ -81,7 +81,7 @@ function onAgentCreated({ id, fiscalName }, data) { @@ -90,7 +90,7 @@ function onAgentCreated({ id, fiscalName }, data) { :label="t('Street address')" clearable v-model="data.street" - required + :required="true" /> diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index fdb8e30e1..d650bbbda 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -149,7 +149,12 @@ async function handleDialog(data) { const toCustomerAddress = () => { notes.value = []; deletes.value = []; - router.go(); + router.push({ + name: 'CustomerAddress', + params: { + id: route.params.id, + }, + }); }; function handleLocation(data, location) { const { town, code, provinceFk, countryFk } = location ?? {}; diff --git a/test/cypress/integration/client/clientAddress.spec.js b/test/cypress/integration/client/clientAddress.spec.js index db876b64b..434180047 100644 --- a/test/cypress/integration/client/clientAddress.spec.js +++ b/test/cypress/integration/client/clientAddress.spec.js @@ -3,11 +3,46 @@ describe('Client consignee', () => { beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); - cy.visit('#/customer/1110/address', { - timeout: 5000, - }); + cy.visit('#/customer/1107/address'); + cy.domContentLoad(); }); it('Should load layout', () => { cy.get('.q-card').should('be.visible'); }); + + it('check as equalizated', function () { + cy.get('.q-card__section > .address-card').then(($el) => { + let addressCards_before = $el.length; + + cy.get('.q-page-sticky > div > .q-btn').click(); + const addressName = 'test'; + cy.dataCy('Consignee_input').type(addressName); + cy.dataCy('Location_select').click(); + cy.get('[role="listbox"] .q-item:nth-child(1)').click(); + cy.dataCy('Street address_input').type('TEST ADDRESS'); + cy.get('.q-btn-group > .q-btn--standard').click(); + cy.location('href').should('contain', '#/customer/1107/address'); + cy.get('.q-card__section > .address-card').should( + 'have.length', + addressCards_before + 1, + ); + cy.get('.q-card__section > .address-card') + .eq(addressCards_before) + .should('be.visible') + .get('.text-weight-bold') + .eq(addressCards_before - 1) + .should('contain', addressName) + .click(); + }); + cy.get( + '.q-card > :nth-child(1) > :nth-child(2) > .q-checkbox > .q-checkbox__inner', + ) + .should('have.class', 'q-checkbox__inner--falsy') + .click(); + + cy.get('.q-btn-group > .q-btn--standard > .q-btn__content').click(); + cy.get( + ':nth-child(2) > :nth-child(2) > .flex > .q-mr-lg > .q-checkbox__inner', + ).should('have.class', 'q-checkbox__inner--truthy'); + }); }); diff --git a/test/cypress/integration/client/clientFiscalData.spec.js b/test/cypress/integration/client/clientFiscalData.spec.js index 05e0772e9..d189f896a 100644 --- a/test/cypress/integration/client/clientFiscalData.spec.js +++ b/test/cypress/integration/client/clientFiscalData.spec.js @@ -3,9 +3,8 @@ describe('Client fiscal data', () => { beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); - cy.visit('#/customer/1107/fiscal-data', { - timeout: 5000, - }); + cy.visit('#/customer/1107/fiscal-data'); + cy.domContentLoad(); }); it('Should change required value when change customer', () => { cy.get('.q-card').should('be.visible'); @@ -15,4 +14,25 @@ describe('Client fiscal data', () => { cy.get('.q-item > .q-item__label').should('have.text', ' #1'); cy.dataCy('sageTaxTypeFk').filter('input').should('have.attr', 'required'); }); + + it('check as equalizated', () => { + cy.get( + ':nth-child(1) > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg', + ).click(); + cy.get('.q-btn-group > .q-btn--standard > .q-btn__content').click(); + + cy.get('.q-card > :nth-child(1) > span').should( + 'contain', + 'You changed the equalization tax', + ); + + cy.get('.q-card > :nth-child(2) > span').should( + 'have.text', + 'Do you want to spread the change?', + ); + cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click(); + cy.get( + '.bg-warning > .q-notification__wrapper > .q-notification__content > .q-notification__message', + ).should('have.text', 'Equivalent tax spreaded'); + }); });