forked from verdnatura/salix-front
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
/// <reference types="cypress" />
|
|
describe('InvoiceInList', () => {
|
|
const firstCard = '.q-card:nth-child(1)';
|
|
const firstChipId =
|
|
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
|
const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)';
|
|
const summaryHeaders = '.summaryBody .header-link';
|
|
|
|
beforeEach(() => {
|
|
cy.viewport(1920, 1080);
|
|
cy.login('developer');
|
|
cy.visit(`/#/invoice-in/list`);
|
|
});
|
|
|
|
it('should redirect on clicking a invoice', () => {
|
|
cy.get(firstChipId)
|
|
.invoke('text')
|
|
.then((content) => {
|
|
const id = content.replace(/\D/g, '');
|
|
cy.get(firstCard).click();
|
|
cy.url().should('include', `/invoice-in/${id}/summary`);
|
|
});
|
|
});
|
|
|
|
it('should open the details', () => {
|
|
cy.get(firstDetailBtn).click();
|
|
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
|
cy.get(summaryHeaders).eq(4).contains('Vat');
|
|
});
|
|
});
|