test: refs #6943 fix tests
gitea/salix-front/pipeline/pr-test There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2025-02-17 00:38:28 +01:00
parent fc80946817
commit 54b4791849
4 changed files with 69 additions and 9 deletions

View File

@ -81,7 +81,7 @@ function onAgentCreated({ id, fiscalName }, data) {
<VnRow>
<VnInput
:label="t('Consignee')"
required
:required="true"
clearable
v-model="data.nickname"
/>
@ -90,7 +90,7 @@ function onAgentCreated({ id, fiscalName }, data) {
:label="t('Street address')"
clearable
v-model="data.street"
required
:required="true"
/>
</VnRow>

View File

@ -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 ?? {};

View File

@ -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');
});
});

View File

@ -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');
});
});