0
0
Fork 0

ref #5835 fix due-day

This commit is contained in:
Jorge Penadés 2023-11-09 15:17:09 +01:00
parent 46ee2a0075
commit b6e8658de9
2 changed files with 13 additions and 18 deletions

View File

@ -65,16 +65,10 @@ const columns = computed(() => [
]);
const isNotEuro = (code) => code != 'EUR';
const areRows = ref(null);
async function insert() {
if (!areRows.value) {
await axios.post('/InvoiceInDueDays/new ', { id: Number(invoiceId) });
await invoiceInFormRef.value.reload();
}
if (areRows.value) {
invoiceInFormRef.value.insert();
}
await axios.post('/InvoiceInDueDays/new ', { id: Number(invoiceId) });
await invoiceInFormRef.value.reload();
}
</script>
<template>

View File

@ -2,28 +2,29 @@
describe('InvoiceInDueDay', () => {
const inputs = 'label input';
const inputBtns = 'label button';
const dialogBtns = '.q-dialog button';
const addBtn = '.q-page-sticky > div > .q-btn > .q-btn__content';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/invoice-in/1/due-day`);
cy.visit(`/#/invoice-in/6/due-day`);
});
it('should update the amount', () => {
cy.get(inputBtns).eq(0).click();
cy.get(inputBtns).eq(1).click();
cy.get(inputs).eq(3).type(23);
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('should add a new row ', () => {
cy.addRow();
cy.get(inputs).eq(11).type(8);
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('should remove the first line', () => {
cy.removeRow(1);
});
it('should add a new row ', () => {
cy.waitForElement('thead');
cy.get(addBtn).click();
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
});