forked from verdnatura/salix-front
fix: refs refs #4466 tests
This commit is contained in:
parent
1883cb79ab
commit
b76c2a35a8
|
@ -76,13 +76,8 @@ defineExpose({
|
||||||
reset,
|
reset,
|
||||||
hasChanges,
|
hasChanges,
|
||||||
saveChanges,
|
saveChanges,
|
||||||
getFormData,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function getFormData() {
|
|
||||||
return formData.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetch(data) {
|
async function fetch(data) {
|
||||||
if (data && Array.isArray(data)) {
|
if (data && Array.isArray(data)) {
|
||||||
let $index = 0;
|
let $index = 0;
|
||||||
|
@ -202,7 +197,6 @@ function getChanges() {
|
||||||
|
|
||||||
const pk = $props.primaryKey;
|
const pk = $props.primaryKey;
|
||||||
for (const [i, row] of formData.value.entries()) {
|
for (const [i, row] of formData.value.entries()) {
|
||||||
console.log(pk, row);
|
|
||||||
if (!row[pk]) {
|
if (!row[pk]) {
|
||||||
creates.push(row);
|
creates.push(row);
|
||||||
} else if (originalData.value) {
|
} else if (originalData.value) {
|
||||||
|
@ -217,7 +211,6 @@ function getChanges() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const changes = { updates, creates };
|
const changes = { updates, creates };
|
||||||
console.log('ddd', changes);
|
|
||||||
for (let prop in changes) {
|
for (let prop in changes) {
|
||||||
if (changes[prop].length === 0) changes[prop] = undefined;
|
if (changes[prop].length === 0) changes[prop] = undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
describe('InvoiceInCorrective', () => {
|
describe('InvoiceInCorrective', () => {
|
||||||
const createRectificative = '.q-menu > .q-list > :nth-child(4) > .q-item__section';
|
const createRectificative = '.q-menu > .q-list > :nth-child(4) > .q-item__section';
|
||||||
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
||||||
|
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
||||||
|
|
||||||
it('should create a correcting invoice', () => {
|
it('should create a correcting invoice', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
@ -12,7 +13,7 @@ describe('InvoiceInCorrective', () => {
|
||||||
cy.openActionsDescriptor();
|
cy.openActionsDescriptor();
|
||||||
|
|
||||||
cy.get(createRectificative).click();
|
cy.get(createRectificative).click();
|
||||||
cy.clickConfirm();
|
cy.get(saveDialog).click();
|
||||||
cy.openLeftMenu();
|
cy.openLeftMenu();
|
||||||
cy.get(rectificativeSection).click();
|
cy.get(rectificativeSection).click();
|
||||||
cy.get('tbody > tr:visible').should('have.length', 1);
|
cy.get('tbody > tr:visible').should('have.length', 1);
|
||||||
|
|
|
@ -8,8 +8,7 @@ describe('InvoiceInList', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-in`);
|
cy.visit(`/#/invoice-in/list`);
|
||||||
cy.clickFilterSearchBtn();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect on clicking a invoice', () => {
|
it('should redirect on clicking a invoice', () => {
|
||||||
|
|
|
@ -88,7 +88,7 @@ Cypress.Commands.add('addCard', () => {
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('clickConfirm', () => {
|
Cypress.Commands.add('clickConfirm', () => {
|
||||||
cy.waitForElement('.q-dialog__inner > .q-card');
|
cy.waitForElement('.q-dialog__inner > .q-card');
|
||||||
cy.get('.q-card > .q-card__actions > .q-btn--standard').click();
|
cy.get('.q-card__actions > .q-btn--unelevated > .q-btn__content > .block').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('notificationHas', (selector, text) => {
|
Cypress.Commands.add('notificationHas', (selector, text) => {
|
||||||
|
@ -184,10 +184,6 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
||||||
cy.get(selector).should('have.text', expectedValue);
|
cy.get(selector).should('have.text', expectedValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('clickFilterSearchBtn', () => {
|
|
||||||
cy.get('.q-item__section > .q-btn > .q-btn__content > .q-icon').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
Cypress.Commands.add('openActionsDescriptor', () => {
|
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||||
cy.get('.descriptor > .header > .q-btn').click();
|
cy.get('.descriptor > .header > .q-btn').click();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue