2023-10-31 07:56:51 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
describe('InvoiceInList', () => {
|
|
|
|
const firstCard = '.q-card:nth-child(1)';
|
|
|
|
const firstId =
|
|
|
|
'.q-card:nth-child(1) .list-items > .vn-label-value:first-child > .value > span';
|
|
|
|
const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)';
|
|
|
|
const summaryHeaders = '.summaryBody .header';
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.login('developer');
|
|
|
|
cy.visit(`/#/invoice-in`);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should redirect on clicking a invoice', () => {
|
|
|
|
cy.get(firstId)
|
|
|
|
.invoke('text')
|
|
|
|
.then((id) => {
|
|
|
|
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
|
|
|
});
|
|
|
|
});
|