2020-11-23 17:27:32 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Travel extra community path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('buyer', 'travel');
|
|
|
|
await page.accessToSection('travel.extraCommunity');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
2021-01-19 10:25:05 +00:00
|
|
|
it('should edit the travel reference and the locked kilograms', async() => {
|
2020-11-23 17:27:32 +00:00
|
|
|
await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter);
|
2020-12-30 13:54:51 +00:00
|
|
|
await page.waitForSpinnerLoad();
|
2022-09-13 13:11:14 +00:00
|
|
|
await page.clearInput(selectors.travelExtraCommunity.firstTravelReference);
|
|
|
|
await page.write(selectors.travelExtraCommunity.firstTravelReference, 'edited reference');
|
|
|
|
await page.clearInput(selectors.travelExtraCommunity.firstTravelLockedKg);
|
|
|
|
await page.write(selectors.travelExtraCommunity.firstTravelLockedKg, '1500');
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('Data saved!');
|
2021-01-18 13:53:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should reload the index and confirm the reference and locked kg were edited', async() => {
|
2020-11-23 17:27:32 +00:00
|
|
|
await page.accessToSection('travel.index');
|
|
|
|
await page.accessToSection('travel.extraCommunity');
|
|
|
|
await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter);
|
2022-09-13 13:11:14 +00:00
|
|
|
|
|
|
|
const reference = await page.waitToGetProperty(selectors.travelExtraCommunity.firstTravelReference, 'value');
|
|
|
|
const lockedKg = await page.waitToGetProperty(selectors.travelExtraCommunity.firstTravelLockedKg, 'value');
|
2020-11-23 17:27:32 +00:00
|
|
|
|
|
|
|
expect(reference).toContain('edited reference');
|
2021-01-18 13:53:15 +00:00
|
|
|
expect(lockedKg).toContain(1500);
|
2020-11-23 17:27:32 +00:00
|
|
|
});
|
|
|
|
});
|