test: remove #q-
This commit is contained in:
parent
444f68e937
commit
007b95a616
|
@ -48,12 +48,14 @@ const onDataSaved = (...args) => {
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:rules="validate('city.name')"
|
:rules="validate('city.name')"
|
||||||
required
|
required
|
||||||
|
data-cy="cityName"
|
||||||
/>
|
/>
|
||||||
<VnSelectProvince
|
<VnSelectProvince
|
||||||
:province-selected="$props.provinceSelected"
|
:province-selected="$props.provinceSelected"
|
||||||
:country-fk="$props.countryFk"
|
:country-fk="$props.countryFk"
|
||||||
v-model="data.provinceFk"
|
v-model="data.provinceFk"
|
||||||
required
|
required
|
||||||
|
data-cy="provinceCity"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -129,7 +129,7 @@ async function filterTowns(name) {
|
||||||
ref="provincesFetchDataRef"
|
ref="provincesFetchDataRef"
|
||||||
@on-fetch="handleProvinces"
|
@on-fetch="handleProvinces"
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
:limit="2"
|
:limit="30"
|
||||||
auto-load
|
auto-load
|
||||||
url="Provinces/location"
|
url="Provinces/location"
|
||||||
/>
|
/>
|
||||||
|
@ -153,7 +153,6 @@ async function filterTowns(name) {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
{{ whereTowns }}
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Postcode')"
|
:label="t('Postcode')"
|
||||||
|
@ -172,7 +171,6 @@ async function filterTowns(name) {
|
||||||
:options="townsOptions"
|
:options="townsOptions"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
@input-value="(evt) => (whereTowns.name = { like: `%${evt}%` })"
|
|
||||||
:rules="validate('postcode.city')"
|
:rules="validate('postcode.city')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
|
@ -213,7 +211,7 @@ async function filterTowns(name) {
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
ref="countriesRef"
|
ref="countriesRef"
|
||||||
:limit="2"
|
:limit="30"
|
||||||
:filter="countryFilter"
|
:filter="countryFilter"
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -53,8 +53,10 @@ const where = computed(() => {
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:rules="validate('province.name')"
|
:rules="validate('province.name')"
|
||||||
required
|
required
|
||||||
|
data-cy="provinceName"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
data-cy="autonomyProvince"
|
||||||
required
|
required
|
||||||
ref="autonomiesRef"
|
ref="autonomiesRef"
|
||||||
auto-load
|
auto-load
|
||||||
|
|
|
@ -116,7 +116,7 @@ describe('VnLocation', () => {
|
||||||
checkVnLocation(postCode, province);
|
checkVnLocation(postCode, province);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Create city without country', () => {
|
it.only('Create city without country', () => {
|
||||||
const postCode = randomNumber();
|
const postCode = randomNumber();
|
||||||
const province = randomString({ length: 4 });
|
const province = randomString({ length: 4 });
|
||||||
cy.get(createLocationButton).click();
|
cy.get(createLocationButton).click();
|
||||||
|
@ -124,8 +124,8 @@ describe('VnLocation', () => {
|
||||||
cy.get(
|
cy.get(
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
||||||
).click();
|
).click();
|
||||||
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
|
cy.selectOption('[data-cy="locationProvince"]:last', 'Province one');
|
||||||
cy.get('#q-portal--dialog--3 .q-input').type(province);
|
cy.get('[data-cy="cityName"]').type(province);
|
||||||
cy.dataCy('FormModelPopup_save').eq(1).click();
|
cy.dataCy('FormModelPopup_save').eq(1).click();
|
||||||
cy.dataCy('FormModelPopup_save').eq(0).click();
|
cy.dataCy('FormModelPopup_save').eq(0).click();
|
||||||
|
|
||||||
|
@ -133,22 +133,7 @@ describe('VnLocation', () => {
|
||||||
checkVnLocation(postCode, province);
|
checkVnLocation(postCode, province);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('Create province without country', () => {
|
it.only('Create city with country', () => {
|
||||||
const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
|
|
||||||
cy.get(createLocationButton).click();
|
|
||||||
cy.get(
|
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
|
||||||
)
|
|
||||||
.eq(0)
|
|
||||||
.click();
|
|
||||||
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
|
|
||||||
cy.countSelectOptions('#q-portal--dialog--3 .q-select', 4);
|
|
||||||
cy.get('#q-portal--dialog--3 .q-input').type(provinceName);
|
|
||||||
|
|
||||||
cy.dataCy('FormModelPopup_save').eq(1).click();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Create city with country', () => {
|
|
||||||
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
|
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||||
cy.get(createLocationButton).click();
|
cy.get(createLocationButton).click();
|
||||||
cy.selectOption(
|
cy.selectOption(
|
||||||
|
@ -158,10 +143,25 @@ describe('VnLocation', () => {
|
||||||
cy.get(
|
cy.get(
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
||||||
).click();
|
).click();
|
||||||
cy.selectOption('#q-portal--dialog--4 .q-select', 'Province four');
|
cy.selectOption('[data-cy="locationProvince"]:last', 'Province four');
|
||||||
cy.countSelectOptions('#q-portal--dialog--4 .q-select', 1);
|
cy.countSelectOptions('[data-cy="locationProvince"]:last', 1);
|
||||||
|
|
||||||
|
cy.get('[data-cy="cityName"]').type(cityName);
|
||||||
|
cy.dataCy('FormModelPopup_save').eq(1).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Create province without country', () => {
|
||||||
|
const provinceName = 'Saskatchew'.concat(Math.random(1 * 100));
|
||||||
|
cy.get(createLocationButton).click();
|
||||||
|
cy.get(
|
||||||
|
`${createForm.prefix} > :nth-child(5) > .q-select > ${createForm.sufix} > :nth-child(2) `
|
||||||
|
)
|
||||||
|
.eq(0)
|
||||||
|
.click();
|
||||||
|
cy.selectOption('[data-cy="autonomyProvince"] ', 'Autonomy one');
|
||||||
|
cy.countSelectOptions('[data-cy="autonomyProvince"]', 4);
|
||||||
|
cy.get('[data-cy="provinceName"]').type(provinceName);
|
||||||
|
|
||||||
cy.get('#q-portal--dialog--4 .q-input').type(cityName);
|
|
||||||
cy.dataCy('FormModelPopup_save').eq(1).click();
|
cy.dataCy('FormModelPopup_save').eq(1).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -178,10 +178,10 @@ describe('VnLocation', () => {
|
||||||
.eq(0)
|
.eq(0)
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.selectOption('#q-portal--dialog--4 .q-select', 'one');
|
cy.selectOption('[data-cy="autonomyProvince"] ', 'Autonomy one');
|
||||||
cy.countSelectOptions('#q-portal--dialog--4 .q-select', 2);
|
cy.countSelectOptions('[data-cy="autonomyProvince"]', 2);
|
||||||
|
|
||||||
cy.get('#q-portal--dialog--4 .q-input').type(provinceName);
|
cy.get('[data-cy="provinceName"]').type(provinceName);
|
||||||
cy.dataCy('FormModelPopup_save').eq(1).click();
|
cy.dataCy('FormModelPopup_save').eq(1).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue