2018-10-25 14:44:03 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import createNightmare from '../../helpers/nightmare';
|
|
|
|
|
|
|
|
describe('Ticket List components path', () => {
|
|
|
|
const nightmare = createNightmare();
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('employee', 'ticket')
|
|
|
|
.accessToSearchResult('id:1')
|
|
|
|
.accessToSection('ticket.card.components');
|
2018-10-25 14:44:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the total base is correct', async () => {
|
|
|
|
const name = 'Base €';
|
|
|
|
const minLength = name.length;
|
|
|
|
|
|
|
|
const base = await nightmare
|
|
|
|
.waitPropertyLength(selectors.ticketComponents.base, 'innerText', minLength)
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.ticketComponents.base, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
expect(base).toContain('Base');
|
|
|
|
expect(base.length).toBeGreaterThan(minLength);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the total margin is correct', async () => {
|
|
|
|
const name = 'Margin €';
|
|
|
|
const minLength = name.length;
|
|
|
|
|
|
|
|
const margin = await nightmare
|
|
|
|
.waitPropertyLength(selectors.ticketComponents.margin, 'innerText', minLength)
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.ticketComponents.margin, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
expect(margin).toContain('Margin');
|
|
|
|
expect(margin.length).toBeGreaterThan(minLength);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the total total is correct', async () => {
|
|
|
|
const name = 'Total €';
|
|
|
|
const minLength = name.length;
|
|
|
|
|
|
|
|
const total = await nightmare
|
|
|
|
.waitPropertyLength(selectors.ticketComponents.total, 'innerText', minLength)
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.ticketComponents.total, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
expect(total).toContain('Total');
|
|
|
|
expect(total.length).toBeGreaterThan(minLength);
|
|
|
|
});
|
|
|
|
});
|