2018-02-26 12:24:47 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../../helpers/nightmare';
|
2018-02-26 12:24:47 +00:00
|
|
|
|
2018-11-02 12:36:20 +00:00
|
|
|
describe('Item edit tax path', () => {
|
|
|
|
const nightmare = createNightmare();
|
|
|
|
|
|
|
|
beforeAll(() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('buyer', 'item')
|
|
|
|
.accessToSearchResult('Gem of Time')
|
|
|
|
.accessToSection('item.card.tax');
|
2018-11-02 12:36:20 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it(`should add the item tax to all countries`, async () => {
|
|
|
|
const result = await nightmare
|
|
|
|
.waitToClick(selectors.itemTax.firstClassSelect)
|
|
|
|
.waitToClick(selectors.itemTax.firstClassSelectOptionTwo)
|
|
|
|
.waitToClick(selectors.itemTax.secondClassSelect)
|
|
|
|
.waitToClick(selectors.itemTax.secondClassSelectOptionOne)
|
|
|
|
.waitToClick(selectors.itemTax.thirdClassSelect)
|
|
|
|
.waitToClick(selectors.itemTax.thirdClassSelectOptionTwo)
|
|
|
|
.click(selectors.itemTax.submitTaxButton)
|
|
|
|
.waitForLastSnackbar();
|
|
|
|
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the first item tax class was edited`, async () => {
|
|
|
|
const firstVatType = await nightmare
|
|
|
|
.click(selectors.itemTags.tagsButton)
|
|
|
|
.wait(selectors.itemTags.firstTagDisabled)
|
|
|
|
.click(selectors.itemTax.taxButton)
|
|
|
|
.waitToClick(selectors.itemTax.taxButton)
|
|
|
|
.waitForTextInInput(selectors.itemTax.firstClassSelect, 'reduced')
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemTax.firstClassSelect, 'value');
|
2018-11-02 12:36:20 +00:00
|
|
|
|
|
|
|
expect(firstVatType).toEqual('Reduced VAT');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the second item tax class was edited`, async () => {
|
|
|
|
const secondVatType = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemTax.secondClassSelect, 'value');
|
2018-11-02 12:36:20 +00:00
|
|
|
|
|
|
|
expect(secondVatType).toEqual('General VAT');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the third item tax class was edited`, async () => {
|
|
|
|
const thirdVatType = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemTax.thirdClassSelect, 'value');
|
2018-11-02 12:36:20 +00:00
|
|
|
|
|
|
|
expect(thirdVatType).toEqual('Reduced VAT');
|
2018-02-26 12:24:47 +00:00
|
|
|
});
|
|
|
|
});
|