2020-02-13 08:47:05 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Client summary path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('employee', 'client');
|
|
|
|
await page.accessToSearchResult('Petter Parker');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should reach the first route summary section', async() => {
|
2020-03-24 15:49:36 +00:00
|
|
|
await page.waitForState('client.card.summary');
|
2020-02-13 08:47:05 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should display details from the client on the header', async() => {
|
|
|
|
await page.waitForTextInElement(selectors.clientSummary.header, 'Petter Parker');
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.header, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Petter Parker');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display some basic data', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.email, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('PetterParker@mydomain.com');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display fiscal address details', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.street, 'innerText');
|
|
|
|
|
2023-07-17 10:30:48 +00:00
|
|
|
expect(result).toContain('20 INGRAM STREET');
|
2020-02-13 08:47:05 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should display some fiscal data', async() => {
|
|
|
|
await page.waitForClassPresent(selectors.clientSummary.verifiedData, 'checked');
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.verifiedData, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Verified data');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display pay method details', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.payMethod, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('PayMethod five');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display default address details', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.defaultAdressName, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Petter Parker');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display web access details', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.userName, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('PetterParker');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display business data', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.rate, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('%');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should display financial information', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.clientSummary.credit, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('€300.00');
|
|
|
|
});
|
|
|
|
});
|