0
0
Fork 0

test: remove #q-

This commit is contained in:
Javier Segarra 2024-12-02 00:50:31 +01:00
parent 444f68e937
commit 007b95a616
4 changed files with 31 additions and 29 deletions

View File

@ -48,12 +48,14 @@ const onDataSaved = (...args) => {
v-model="data.name"
:rules="validate('city.name')"
required
data-cy="cityName"
/>
<VnSelectProvince
:province-selected="$props.provinceSelected"
:country-fk="$props.countryFk"
v-model="data.provinceFk"
required
data-cy="provinceCity"
/>
</VnRow>
</template>

View File

@ -129,7 +129,7 @@ async function filterTowns(name) {
ref="provincesFetchDataRef"
@on-fetch="handleProvinces"
:sort-by="['name ASC']"
:limit="2"
:limit="30"
auto-load
url="Provinces/location"
/>
@ -153,7 +153,6 @@ async function filterTowns(name) {
@on-data-saved="onDataSaved"
>
<template #form-inputs="{ data, validate }">
{{ whereTowns }}
<VnRow>
<VnInput
:label="t('Postcode')"
@ -172,7 +171,6 @@ async function filterTowns(name) {
:options="townsOptions"
option-label="name"
option-value="id"
@input-value="(evt) => (whereTowns.name = { like: `%${evt}%` })"
:rules="validate('postcode.city')"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:emit-value="false"
@ -213,7 +211,7 @@ async function filterTowns(name) {
/>
<VnSelect
ref="countriesRef"
:limit="2"
:limit="30"
:filter="countryFilter"
:sort-by="['name ASC']"
auto-load

View File

@ -53,8 +53,10 @@ const where = computed(() => {
v-model="data.name"
:rules="validate('province.name')"
required
data-cy="provinceName"
/>
<VnSelect
data-cy="autonomyProvince"
required
ref="autonomiesRef"
auto-load

View File

@ -116,7 +116,7 @@ describe('VnLocation', () => {
checkVnLocation(postCode, province);
});
it('Create city without country', () => {
it.only('Create city without country', () => {
const postCode = randomNumber();
const province = randomString({ length: 4 });
cy.get(createLocationButton).click();
@ -124,8 +124,8 @@ describe('VnLocation', () => {
cy.get(
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) `
).click();
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
cy.get('#q-portal--dialog--3 .q-input').type(province);
cy.selectOption('[data-cy="locationProvince"]:last', 'Province one');
cy.get('[data-cy="cityName"]').type(province);
cy.dataCy('FormModelPopup_save').eq(1).click();
cy.dataCy('FormModelPopup_save').eq(0).click();
@ -133,22 +133,7 @@ describe('VnLocation', () => {
checkVnLocation(postCode, province);
});
it.only('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('#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', () => {
it.only('Create city with country', () => {
const cityName = 'Saskatchew'.concat(Math.random(1 * 100));
cy.get(createLocationButton).click();
cy.selectOption(
@ -158,10 +143,25 @@ describe('VnLocation', () => {
cy.get(
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) `
).click();
cy.selectOption('#q-portal--dialog--4 .q-select', 'Province four');
cy.countSelectOptions('#q-portal--dialog--4 .q-select', 1);
cy.selectOption('[data-cy="locationProvince"]:last', 'Province four');
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();
});
@ -178,10 +178,10 @@ describe('VnLocation', () => {
.eq(0)
.click();
cy.selectOption('#q-portal--dialog--4 .q-select', 'one');
cy.countSelectOptions('#q-portal--dialog--4 .q-select', 2);
cy.selectOption('[data-cy="autonomyProvince"] ', 'Autonomy one');
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();
});