2020-02-07 14:42:11 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('InvoiceOut summary path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('employee', 'invoiceOut');
|
|
|
|
await page.accessToSearchResult('T1111111');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should reach the summary section', async() => {
|
2020-03-24 15:49:36 +00:00
|
|
|
await page.waitForState('invoiceOut.card.summary');
|
2020-02-07 14:42:11 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should contain the company from which the invoice is emited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.invoiceOutSummary.company, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toEqual('Company VNL');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should contain the tax breakdown', async() => {
|
|
|
|
const firstTax = await page.waitToGetProperty(selectors.invoiceOutSummary.taxOne, 'innerText');
|
|
|
|
const secondTax = await page.waitToGetProperty(selectors.invoiceOutSummary.taxTwo, 'innerText');
|
|
|
|
|
|
|
|
expect(firstTax).toContain('10%');
|
|
|
|
expect(secondTax).toContain('21%');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should contain the tickets info', async() => {
|
|
|
|
const firstTicket = await page.waitToGetProperty(selectors.invoiceOutSummary.ticketOne, 'innerText');
|
|
|
|
const secondTicket = await page.waitToGetProperty(selectors.invoiceOutSummary.ticketTwo, 'innerText');
|
|
|
|
|
|
|
|
expect(firstTicket).toContain('Bat cave');
|
2023-12-14 14:56:49 +00:00
|
|
|
expect(secondTicket).toContain('Bat cave');
|
2020-02-07 14:42:11 +00:00
|
|
|
});
|
|
|
|
});
|