37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import selectors from '../../helpers/selectors';
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
describe('Client DMS', () => {
|
|
let browser;
|
|
let page;
|
|
beforeAll(async() => {
|
|
browser = await getBrowser();
|
|
page = browser.page;
|
|
await page.loginAndModule('salesPerson', 'client');
|
|
await page.accessToSearchResult('Tony Stark');
|
|
await page.accessToSection('client.card.dms.index');
|
|
});
|
|
|
|
afterAll(async() => {
|
|
await browser.close();
|
|
});
|
|
|
|
describe('as salesPerson', () => {
|
|
it('should delete de first file', async() => {
|
|
await page.waitToClick(selectors.dms.deleteFileButton);
|
|
await page.respondToDialog('accept');
|
|
const message = await page.waitForSnackbar();
|
|
|
|
expect(message.type).toBe('success');
|
|
});
|
|
|
|
it(`should click on the first document line worker name making the descriptor visible`, async() => {
|
|
await page.waitToClick(selectors.dms.firstDocWorker);
|
|
await page.waitForSelector(selectors.dms.firstDocWorkerDescriptor);
|
|
const visible = await page.isVisible(selectors.dms.firstDocWorkerDescriptor);
|
|
|
|
expect(visible).toBeTruthy();
|
|
});
|
|
});
|
|
});
|