test: improve test
This commit is contained in:
parent
85e932a6b9
commit
c5e8d8ab6f
|
@ -6,7 +6,6 @@ import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
@ -21,9 +20,6 @@ const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const typesTaxes = ref([]);
|
|
||||||
const typesTransactions = ref([]);
|
|
||||||
|
|
||||||
function handleLocation(data, location) {
|
function handleLocation(data, location) {
|
||||||
const { town, code, provinceFk, countryFk } = location ?? {};
|
const { town, code, provinceFk, countryFk } = location ?? {};
|
||||||
data.postcode = code;
|
data.postcode = code;
|
||||||
|
@ -39,6 +35,7 @@ function onBeforeSave(formData, originalData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkEtChanges(data, _, originalData) {
|
async function checkEtChanges(data, _, originalData) {
|
||||||
|
isTaxDataChecked.value = data.isTaxDataChecked;
|
||||||
const equalizatedHasChanged = originalData.isEqualizated != data.isEqualizated;
|
const equalizatedHasChanged = originalData.isEqualizated != data.isEqualizated;
|
||||||
const hasToInvoiceByAddress =
|
const hasToInvoiceByAddress =
|
||||||
originalData.hasToInvoiceByAddress || data.hasToInvoiceByAddress;
|
originalData.hasToInvoiceByAddress || data.hasToInvoiceByAddress;
|
||||||
|
@ -74,12 +71,6 @@ function isRequired({ isTaxDataChecked: taxDataChecked }) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData auto-load @on-fetch="(data) => (typesTaxes = data)" url="SageTaxTypes" />
|
|
||||||
<FetchData
|
|
||||||
auto-load
|
|
||||||
@on-fetch="(data) => (typesTransactions = data)"
|
|
||||||
url="SageTransactionTypes"
|
|
||||||
/>
|
|
||||||
<FormModel
|
<FormModel
|
||||||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||||
auto-load
|
auto-load
|
||||||
|
@ -89,6 +80,7 @@ function isRequired({ isTaxDataChecked: taxDataChecked }) {
|
||||||
@on-data-saved="checkEtChanges"
|
@on-data-saved="checkEtChanges"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate, validations }">
|
<template #form="{ data, validate, validations }">
|
||||||
|
{{ isTaxDataChecked }} {{ data.isTaxDataChecked }}
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Social name')"
|
:label="t('Social name')"
|
||||||
|
|
|
@ -15,6 +15,9 @@ describe('Client fiscal data', () => {
|
||||||
cy.get('.q-card').should('be.visible');
|
cy.get('.q-card').should('be.visible');
|
||||||
checkSageFields();
|
checkSageFields();
|
||||||
cy.get('[data-cy="vnCheckboxVerified data"]').click();
|
cy.get('[data-cy="vnCheckboxVerified data"]').click();
|
||||||
|
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content').click();
|
||||||
|
checkSageFields();
|
||||||
|
cy.get('[data-cy="vnCheckboxVerified data"]').click();
|
||||||
checkSageFields(true);
|
checkSageFields(true);
|
||||||
cy.get('#searchbar input').clear();
|
cy.get('#searchbar input').clear();
|
||||||
cy.get('#searchbar input').type('1{enter}');
|
cy.get('#searchbar input').type('1{enter}');
|
||||||
|
|
Loading…
Reference in New Issue