2023-10-31 07:56:51 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
describe('InvoiceInList', () => {
|
|
|
|
const firstCard = '.q-card:nth-child(1)';
|
2023-12-18 14:39:26 +00:00
|
|
|
const firstChipId =
|
|
|
|
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
2023-10-31 07:56:51 +00:00
|
|
|
const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)';
|
2024-03-20 07:03:25 +00:00
|
|
|
const summaryHeaders = '.summaryBody .header-link';
|
2023-10-31 07:56:51 +00:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2024-07-02 06:29:55 +00:00
|
|
|
cy.viewport(1920, 1080);
|
2023-10-31 07:56:51 +00:00
|
|
|
cy.login('developer');
|
2024-02-06 14:11:59 +00:00
|
|
|
cy.visit(`/#/invoice-in/list`);
|
2023-10-31 07:56:51 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should redirect on clicking a invoice', () => {
|
2023-12-18 14:39:26 +00:00
|
|
|
cy.get(firstChipId)
|
2023-10-31 07:56:51 +00:00
|
|
|
.invoke('text')
|
2023-12-18 14:39:26 +00:00
|
|
|
.then((content) => {
|
2024-03-20 07:03:25 +00:00
|
|
|
const id = content.replace(/\D/g, '');
|
2023-10-31 07:56:51 +00:00
|
|
|
cy.get(firstCard).click();
|
|
|
|
cy.url().should('include', `/invoice-in/${id}/summary`);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should open the details', () => {
|
|
|
|
cy.get(firstDetailBtn).click();
|
2023-11-09 12:26:03 +00:00
|
|
|
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
|
|
|
cy.get(summaryHeaders).eq(4).contains('Vat');
|
2023-10-31 07:56:51 +00:00
|
|
|
});
|
|
|
|
});
|