import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; describe('InvoiceIn descriptor path', () => { let browser; let page; beforeAll(async() => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('administrative', 'invoiceIn'); await page.accessToSearchResult('10'); }); afterAll(async() => { await browser.close(); }); it('should delete the invoiceIn using the descriptor more menu', async() => { await page.waitToClick(selectors.invoiceInDescriptor.moreMenu); await page.waitToClick(selectors.invoiceInDescriptor.moreMenuDeleteInvoiceIn); await page.waitToClick(selectors.invoiceInDescriptor.acceptDeleteButton); const message = await page.waitForSnackbar(); expect(message.text).toContain('InvoiceIn deleted'); }); it('should have been relocated to the invoiceOut index', async() => { await page.waitForState('invoiceIn.index'); }); it(`should search for the deleted invouceOut to find no results`, async() => { await page.doSearch('10'); const nResults = await page.countElement(selectors.invoiceOutIndex.searchResult); expect(nResults).toEqual(0); }); });