forked from verdnatura/salix-front
fix: emit:updateModelValue
This commit is contained in:
parent
025436b4b8
commit
5796bc9c0a
|
@ -20,6 +20,9 @@ const modelValue = ref(
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
|
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
|
||||||
}
|
}
|
||||||
|
const handleModelValue = (data) => {
|
||||||
|
emit('update:model-value', data);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
|
@ -29,6 +32,7 @@ function showLabel(data) {
|
||||||
(opt) => (typeof modelValue === 'string' ? modelValue : showLabel(opt))
|
(opt) => (typeof modelValue === 'string' ? modelValue : showLabel(opt))
|
||||||
"
|
"
|
||||||
url="Postcodes/filter"
|
url="Postcodes/filter"
|
||||||
|
@update:model-value="handleModelValue"
|
||||||
:use-like="false"
|
:use-like="false"
|
||||||
:label="t('Location')"
|
:label="t('Location')"
|
||||||
:placeholder="t('search_by_postalcode')"
|
:placeholder="t('search_by_postalcode')"
|
||||||
|
|
|
@ -33,11 +33,40 @@ describe('VnLocation', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
|
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
cy.get(createLocationButton).click();
|
|
||||||
});
|
});
|
||||||
|
it('Fin by postalCode', () => {
|
||||||
|
const postCode = '46600';
|
||||||
|
const firstOption = '[role="listbox"] .q-item:nth-child(1)';
|
||||||
|
|
||||||
|
cy.get(inputLocation).click();
|
||||||
|
cy.get(inputLocation).clear();
|
||||||
|
cy.get(inputLocation).type(postCode);
|
||||||
|
cy.get(locationOptions).should('have.length.at.least', 2);
|
||||||
|
cy.get(firstOption).click();
|
||||||
|
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
|
||||||
|
cy.reload();
|
||||||
|
cy.waitForElement('.q-form');
|
||||||
|
// cy.get('[href="#/supplier/567/basic-data"] > .q-item__section--main').click();
|
||||||
|
// cy.get(
|
||||||
|
// '[href="#/supplier/567/fiscal-data"] > .q-item__section--main'
|
||||||
|
// ).click();
|
||||||
|
cy.get(inputLocation).should(
|
||||||
|
'have.value',
|
||||||
|
'46600 - Valencia(Province one), España'
|
||||||
|
);
|
||||||
|
|
||||||
|
// cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
|
||||||
|
// .find('input')
|
||||||
|
// .invoke('val')
|
||||||
|
// .then((text) => {
|
||||||
|
// expect(text).to.contain('46600 - Valencia(Province one), España');
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
|
||||||
it('Create postCode', () => {
|
it('Create postCode', () => {
|
||||||
const postCode = '1234475';
|
const postCode = '1234475';
|
||||||
const province = 'Valencia';
|
const province = 'Valencia';
|
||||||
|
cy.get(createLocationButton).click();
|
||||||
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||||||
cy.get(dialogInputs).eq(0).clear();
|
cy.get(dialogInputs).eq(0).clear();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
|
@ -54,6 +83,7 @@ describe('VnLocation', () => {
|
||||||
it('Create city', () => {
|
it('Create city', () => {
|
||||||
const postCode = '9011';
|
const postCode = '9011';
|
||||||
const province = 'Saskatchew';
|
const province = 'Saskatchew';
|
||||||
|
cy.get(createLocationButton).click();
|
||||||
cy.get(dialogInputs).eq(0).type(postCode);
|
cy.get(dialogInputs).eq(0).type(postCode);
|
||||||
// city create button
|
// city create button
|
||||||
cy.get(
|
cy.get(
|
||||||
|
|
Loading…
Reference in New Issue