2020-02-24 13:34:36 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Entry summary path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('buyer', 'entry');
|
2020-09-09 11:07:06 +00:00
|
|
|
await page.accessToSearchResult('4');
|
2020-02-24 13:34:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should reach the second entry summary section', async() => {
|
2020-03-24 15:49:36 +00:00
|
|
|
await page.waitForState('entry.card.summary');
|
2020-02-24 13:34:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it(`should display details from the entry on the header`, async() => {
|
2020-10-30 07:27:02 +00:00
|
|
|
await page.waitForTextInElement(selectors.entrySummary.header, 'The farmer');
|
2020-02-24 13:34:36 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.entrySummary.header, 'innerText');
|
|
|
|
|
2020-10-30 07:27:02 +00:00
|
|
|
expect(result).toContain('The farmer');
|
2020-02-24 13:34:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should display some entry details like the reference', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entrySummary.reference, 'innerText');
|
|
|
|
|
2020-09-09 11:07:06 +00:00
|
|
|
expect(result).toContain('Movement 4');
|
2020-02-24 13:34:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should display other entry details like the confirmed', async() => {
|
|
|
|
const result = await page.checkboxState(selectors.entrySummary.confirmed, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('unchecked');
|
|
|
|
});
|
2020-09-09 11:07:06 +00:00
|
|
|
|
|
|
|
it('should display all buys for the entry', async() => {
|
|
|
|
const result = await page.countElement(selectors.entrySummary.anyBuyLine);
|
|
|
|
|
|
|
|
expect(result).toEqual(4);
|
|
|
|
});
|
2020-02-24 13:34:36 +00:00
|
|
|
});
|