This commit is contained in:
parent
7323ed03e7
commit
2269565dc2
|
@ -213,7 +213,9 @@ export default {
|
|||
regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`,
|
||||
regularizeWarehouseAutocomplete: 'vn-item-descriptor vn-dialog vn-autocomplete[field="$ctrl.warehouseFk"]',
|
||||
editButton: 'vn-item-card vn-item-descriptor vn-float-button[icon="edit"]',
|
||||
regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button`
|
||||
regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button`,
|
||||
inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]',
|
||||
navigateBackToIndex: 'vn-item-descriptor vn-icon[icon="chevron_left"]'
|
||||
},
|
||||
itemBasicData: {
|
||||
basicDataButton: `vn-left-menu a[ui-sref="item.card.data"]`,
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import createNightmare from '../../helpers/nightmare';
|
||||
|
||||
describe('Item regularize path', () => {
|
||||
const nightmare = createNightmare();
|
||||
beforeAll(() => {
|
||||
nightmare
|
||||
.loginAndModule('developer', 'item')
|
||||
.accessToSearchResult(1)
|
||||
.accessToSection('item.card.data');
|
||||
});
|
||||
|
||||
it('should check the descriptor inactive icon is dark as the item is active', async() => {
|
||||
let darkIcon = await nightmare
|
||||
.wait(selectors.itemDescriptor.inactiveIcon)
|
||||
.waitForClassNotPresent(selectors.itemDescriptor.inactiveIcon, 'bright')
|
||||
.isVisible(selectors.itemDescriptor.inactiveIcon);
|
||||
|
||||
expect(darkIcon).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should set the item to inactive', async() => {
|
||||
let result = await nightmare
|
||||
.waitToClick(selectors.itemBasicData.isActiveCheckbox)
|
||||
.waitToClick(selectors.itemBasicData.submitBasicDataButton)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it('should reload the section and check the inactive icon is bright', async() => {
|
||||
let brightIcon = await nightmare
|
||||
.reloadSection('item.card.data')
|
||||
.waitForClassPresent(selectors.itemDescriptor.inactiveIcon, 'bright')
|
||||
.isVisible(selectors.itemDescriptor.inactiveIcon);
|
||||
|
||||
expect(brightIcon).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should set the item back to active', async() => {
|
||||
let result = await nightmare
|
||||
.waitToClick(selectors.itemBasicData.isActiveCheckbox)
|
||||
.waitToClick(selectors.itemBasicData.submitBasicDataButton)
|
||||
.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue