2019-02-25 10:47:28 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2020-01-23 15:01:29 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-02-25 10:47:28 +00:00
|
|
|
|
2020-05-14 15:15:54 +00:00
|
|
|
describe('Claim action path', () => {
|
2020-01-23 15:01:29 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
2020-10-26 11:16:57 +00:00
|
|
|
await page.loginAndModule('claimManager', 'claim');
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.accessToSearchResult('2');
|
|
|
|
await page.accessToSection('claim.card.action');
|
|
|
|
});
|
2019-02-25 10:47:28 +00:00
|
|
|
|
2020-01-23 15:01:29 +00:00
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
2019-02-25 10:47:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should import the claim', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.claimAction.importClaimButton);
|
2020-04-08 09:24:40 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2019-02-25 10:47:28 +00:00
|
|
|
|
2020-11-10 11:06:21 +00:00
|
|
|
expect(message.text).toContain('Data saved!');
|
2019-02-25 10:47:28 +00:00
|
|
|
});
|
|
|
|
|
2019-06-14 10:27:41 +00:00
|
|
|
it('should delete the first line', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.claimAction.firstDeleteLine);
|
2020-04-08 09:24:40 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2019-02-25 10:47:28 +00:00
|
|
|
|
2020-11-10 11:06:21 +00:00
|
|
|
expect(message.text).toContain('Data saved!');
|
2019-02-25 10:47:28 +00:00
|
|
|
});
|
|
|
|
|
2022-02-24 12:52:26 +00:00
|
|
|
it('should refresh the view to check not have lines', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.reloadSection('claim.card.action');
|
2022-02-24 12:52:26 +00:00
|
|
|
const result = await page.countElement(selectors.claimAction.anyLine);
|
2019-02-25 10:47:28 +00:00
|
|
|
|
2022-02-24 12:52:26 +00:00
|
|
|
expect(result).toEqual(0);
|
2019-02-25 10:47:28 +00:00
|
|
|
});
|
2019-06-04 09:00:05 +00:00
|
|
|
|
2019-06-14 10:27:41 +00:00
|
|
|
it('should check the "is paid with mana" checkbox', async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.claimAction.isPaidWithManaCheckbox);
|
2020-04-08 09:24:40 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2019-06-04 09:00:05 +00:00
|
|
|
|
2020-11-10 11:06:21 +00:00
|
|
|
expect(message.text).toContain('Data saved!');
|
2019-06-04 09:00:05 +00:00
|
|
|
});
|
|
|
|
|
2020-06-03 12:46:58 +00:00
|
|
|
it('should confirm the "is paid with mana" is checked', async() => {
|
|
|
|
await page.reloadSection('claim.card.action');
|
|
|
|
const isPaidWithManaCheckbox = await page.checkboxState(selectors.claimAction.isPaidWithManaCheckbox);
|
|
|
|
|
|
|
|
expect(isPaidWithManaCheckbox).toBe('checked');
|
2020-05-14 12:30:43 +00:00
|
|
|
});
|
2019-02-25 10:47:28 +00:00
|
|
|
});
|