Merge branch 'dev' into 7949-TicketModifications
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
3b8db365ab
|
@ -185,6 +185,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
data-key="InvoiceInSummary"
|
||||
:url="`InvoiceIns/${entityId}/summary`"
|
||||
@on-fetch="(data) => init(data)"
|
||||
module-name="InvoiceIn"
|
||||
>
|
||||
<template #header="{ entity }">
|
||||
<div>{{ entity.id }} - {{ entity.supplier?.name }}</div>
|
||||
|
|
|
@ -180,6 +180,7 @@ const onDmsSaved = async (dms, response) => {
|
|||
rows: dmsDialog.value.rowsToCreateInvoiceIn,
|
||||
dms: response.data,
|
||||
});
|
||||
notify(t('Data saved'), 'positive');
|
||||
}
|
||||
dmsDialog.value.show = false;
|
||||
dmsDialog.value.initialForm = null;
|
||||
|
@ -243,7 +244,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</template>
|
||||
<template #column-invoiceInFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.invoiceInFk }}
|
||||
{{ row.supplierRef }}
|
||||
<InvoiceInDescriptorProxy v-if="row.invoiceInFk" :id="row.invoiceInFk" />
|
||||
</span>
|
||||
</template>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('ClaimNotes', () => {
|
||||
describe.skip('ClaimNotes', () => {
|
||||
const saveBtn = '.q-field__append > .q-btn > .q-btn__content > .q-icon';
|
||||
const firstNote = '.q-infinite-scroll :nth-child(1) > .q-card__section--vert';
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
describe('RouteAutonomous', () => {
|
||||
const getLinkSelector = (colField) =>
|
||||
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
|
||||
|
||||
const selectors = {
|
||||
reference: 'Reference_input',
|
||||
date: 'tr:first-child > [data-col-field="dated"]',
|
||||
total: '.value > .text-h6',
|
||||
received: getLinkSelector('invoiceInFk'),
|
||||
autonomous: getLinkSelector('supplierName'),
|
||||
firstRowCheckbox: '.q-virtual-scroll__content tr:first-child .q-checkbox__bg',
|
||||
secondRowCheckbox: '.q-virtual-scroll__content tr:nth-child(2) .q-checkbox__bg',
|
||||
createInvoiceBtn: '.q-card > .q-btn',
|
||||
saveFormBtn: 'FormModelPopup_save',
|
||||
summaryIcon: 'tableAction-0',
|
||||
summaryPopupBtn: '.header > :nth-child(2) > .q-btn__content > .q-icon',
|
||||
summaryHeader: '.summaryHeader > :nth-child(2)',
|
||||
descriptorHeader: '.summaryHeader > div',
|
||||
descriptorTitle: '.q-item__label--header > .title > span',
|
||||
summaryGoToSummaryBtn: '.header > .q-icon',
|
||||
descriptorGoToSummaryBtn: '.descriptor > .header > a[href] > .q-btn',
|
||||
};
|
||||
|
||||
const data = {
|
||||
reference: 'Test invoice',
|
||||
total: '€206.40',
|
||||
supplier: 'PLANTS SL',
|
||||
route: 'first route',
|
||||
};
|
||||
|
||||
const summaryUrl = '/summary';
|
||||
const dataSaved = 'Data saved';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/agency-term`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
});
|
||||
|
||||
it('Should list autonomous routes', () => {
|
||||
cy.get('.q-table')
|
||||
.children()
|
||||
.should('be.visible')
|
||||
.should('have.length.greaterThan', 0);
|
||||
});
|
||||
|
||||
it('Should create invoice in to selected route', () => {
|
||||
cy.get(selectors.firstRowCheckbox).click();
|
||||
cy.get(selectors.createInvoiceBtn).click();
|
||||
cy.dataCy(selectors.reference).type(data.reference);
|
||||
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
|
||||
force: true,
|
||||
});
|
||||
cy.dataCy(selectors.saveFormBtn).click();
|
||||
cy.checkNotification(dataSaved);
|
||||
cy.typeSearchbar('{enter}');
|
||||
});
|
||||
|
||||
it('Should display the total price of the selected rows', () => {
|
||||
cy.get(selectors.firstRowCheckbox).click();
|
||||
cy.get(selectors.secondRowCheckbox).click();
|
||||
cy.validateContent(selectors.total, data.total);
|
||||
});
|
||||
|
||||
it('Should redirect to the summary when clicking a route', () => {
|
||||
cy.get(selectors.date).click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.route);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
|
||||
describe('Received pop-ups', () => {
|
||||
it('Should redirect to invoice in summary from the received descriptor pop-up', () => {
|
||||
cy.get(selectors.received).click();
|
||||
cy.validateContent(selectors.descriptorTitle, data.reference);
|
||||
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
|
||||
it('Should redirect to the invoiceIn summary from summary pop-up from the received descriptor pop-up', () => {
|
||||
cy.get(selectors.received).click();
|
||||
cy.validateContent(selectors.descriptorTitle, data.reference);
|
||||
cy.get(selectors.summaryPopupBtn).click();
|
||||
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
|
||||
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Autonomous pop-ups', () => {
|
||||
it('Should redirect to the supplier summary from the received descriptor pop-up', () => {
|
||||
cy.get(selectors.autonomous).click();
|
||||
cy.validateContent(selectors.descriptorTitle, data.supplier);
|
||||
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.supplier);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
|
||||
it('Should redirect to the supplier summary from summary pop-up from the autonomous descriptor pop-up', () => {
|
||||
cy.get(selectors.autonomous).click();
|
||||
cy.get(selectors.descriptorTitle).should('contain', data.supplier);
|
||||
cy.get(selectors.summaryPopupBtn).click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.supplier);
|
||||
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.supplier);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Route pop-ups', () => {
|
||||
it('Should redirect to the summary from the route summary pop-up', () => {
|
||||
cy.dataCy(selectors.summaryIcon).first().click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.route);
|
||||
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.route);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue