forked from verdnatura/salix-front
parent
69e6f0f467
commit
8e37d22164
|
@ -176,7 +176,6 @@ async function handleCountries(data) {
|
|||
@on-data-saved="onDataSaved"
|
||||
>
|
||||
<template #form-inputs="{ data, validate }">
|
||||
{{ data }}
|
||||
<VnRow>
|
||||
<VnInput
|
||||
:label="t('Postcode')"
|
||||
|
@ -210,7 +209,6 @@ async function handleCountries(data) {
|
|||
</template>
|
||||
<template #form>
|
||||
<CreateNewCityForm
|
||||
data-cy="create-new-city-btn"
|
||||
:country-fk="data.countryFk"
|
||||
:province-selected="data.provinceFk"
|
||||
@on-data-saved="
|
||||
|
@ -229,7 +227,6 @@ async function handleCountries(data) {
|
|||
v-model="data.provinceFk"
|
||||
:clearable="true"
|
||||
@on-province-created="onProvinceCreated"
|
||||
data-cy="create-new-province-btn"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('Country')"
|
||||
|
|
|
@ -64,13 +64,11 @@ watch(
|
|||
url="Provinces"
|
||||
auto-load
|
||||
/>
|
||||
{{ $props.countryFk }}
|
||||
<VnSelectDialog
|
||||
:label="t('Province')"
|
||||
:options="provincesOptions"
|
||||
:tooltip="t('Create province')"
|
||||
hide-selected
|
||||
:limit="3"
|
||||
v-model="provinceFk"
|
||||
:rules="validate && validate('postcode.provinceFk')"
|
||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||
|
|
|
@ -18,34 +18,34 @@ describe('VnLocation', () => {
|
|||
it('should filter provinces based on selected country', () => {
|
||||
// Select a country
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) > ${createForm.sufix}`,
|
||||
'Ecuador'
|
||||
);
|
||||
// Verify that provinces are filtered
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) > ${createForm.sufix}`
|
||||
).should('have.length', 1);
|
||||
|
||||
// Verify that towns are filtered
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||
`${createForm.prefix} > :nth-child(4) > :nth-child(2) > ${createForm.sufix}`
|
||||
).should('have.length', 1);
|
||||
});
|
||||
|
||||
it('should filter towns based on selected province', () => {
|
||||
it.only('should filter towns based on selected province', () => {
|
||||
// Select a country
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`,
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) > ${createForm.sufix}`,
|
||||
'Ecuador'
|
||||
);
|
||||
// Verify that provinces are filtered
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(2) > ${createForm.sufix}`
|
||||
).should('have.length', 1);
|
||||
|
||||
// Verify that towns are filtered
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
|
||||
`${createForm.prefix} > :nth-child(4) > :nth-child(2) > ${createForm.sufix}`
|
||||
).should('have.length', 1);
|
||||
});
|
||||
it('should pass selected country', () => {
|
||||
|
@ -53,7 +53,7 @@ describe('VnLocation', () => {
|
|||
const country = 'Ecuador';
|
||||
const province = 'Province five';
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) > ${createForm.sufix}`,
|
||||
country
|
||||
);
|
||||
cy.selectOption(
|
||||
|
@ -137,28 +137,19 @@ describe('VnLocation', () => {
|
|||
|
||||
checkVnLocation(postCode, province);
|
||||
});
|
||||
it.only('Create city without country', () => {
|
||||
// const postCode = '9011';
|
||||
it('Create city without country', () => {
|
||||
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||
cy.get(createLocationButton).click();
|
||||
// cy.get(dialogInputs).eq(0).type(postCode);
|
||||
// city create button
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
|
||||
).click();
|
||||
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
|
||||
cy.get('#q-portal--dialog--3 .q-input').type(cityName);
|
||||
cy.get('#q-portal--dialog--3 .q-btn--standard').click();
|
||||
// cy.get('#q-portal--dialog--1 .q-btn--standard').click();
|
||||
// cy.waitForElement('.q-form');
|
||||
|
||||
// checkVnLocation(postCode, province);
|
||||
});
|
||||
it.only('Create province without country', () => {
|
||||
// const postCode = '9011';
|
||||
it('Create province without country', () => {
|
||||
const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||
cy.get(createLocationButton).click();
|
||||
// cy.get(dialogInputs).eq(0).type(postCode);
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
||||
)
|
||||
|
@ -169,17 +160,10 @@ describe('VnLocation', () => {
|
|||
cy.get('#q-portal--dialog--3 .q-input').type(provinceName);
|
||||
|
||||
cy.get('#q-portal--dialog--3 .q-btn--standard').click();
|
||||
// cy.get('#q-portal--dialog--1 .q-btn--standard').click();
|
||||
// cy.waitForElement('.q-form');
|
||||
|
||||
// checkVnLocation(postCode, province);
|
||||
});
|
||||
it.only('Create city with country', () => {
|
||||
// const postCode = '9011';
|
||||
it('Create city with country', () => {
|
||||
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||
cy.get(createLocationButton).click();
|
||||
// cy.get(dialogInputs).eq(0).type(postCode);
|
||||
// city create button
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
||||
'Italia'
|
||||
|
@ -192,16 +176,10 @@ describe('VnLocation', () => {
|
|||
|
||||
cy.get('#q-portal--dialog--4 .q-input').type(cityName);
|
||||
cy.get('#q-portal--dialog--4 .q-btn--standard').click();
|
||||
// cy.get('#q-portal--dialog--1 .q-btn--standard').click();
|
||||
// cy.waitForElement('.q-form');
|
||||
|
||||
// checkVnLocation(postCode, province);
|
||||
});
|
||||
it.only('Create province with country', () => {
|
||||
// const postCode = '9011';
|
||||
it('Create province with country', () => {
|
||||
const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||
cy.get(createLocationButton).click();
|
||||
// cy.get(dialogInputs).eq(0).type(postCode);
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
||||
'España'
|
||||
|
@ -217,10 +195,6 @@ describe('VnLocation', () => {
|
|||
|
||||
cy.get('#q-portal--dialog--4 .q-input').type(provinceName);
|
||||
cy.get('#q-portal--dialog--4 .q-btn--standard').click();
|
||||
// cy.get('#q-portal--dialog--1 .q-btn--standard').click();
|
||||
// cy.waitForElement('.q-form');
|
||||
|
||||
// checkVnLocation(postCode, province);
|
||||
});
|
||||
function checkVnLocation(postCode, province) {
|
||||
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||
|
|
Loading…
Reference in New Issue