#1051 adaptar item regularize

This commit is contained in:
Carlos Jimenez Ruiz 2019-02-07 15:02:22 +01:00
parent b5a1e52bf3
commit db7bc708e6
1 changed files with 35 additions and 1 deletions

View File

@ -8,6 +8,24 @@ describe('Item regularize path', () => {
.loginAndModule('employee', 'item'); .loginAndModule('employee', 'item');
}); });
it('should edit the user local warehouse', async() => {
let result = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.autocompleteSearch(selectors.globalItems.userLocalWarehouse, 'Warehouse Four')
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should open the user config form to check the local settings', async() => {
let userLocalWarehouse = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
expect(userLocalWarehouse).toContain('Warehouse Four');
});
it('should search for the item', async() => { it('should search for the item', async() => {
const resultCount = await nightmare const resultCount = await nightmare
.write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50') .write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50')
@ -28,10 +46,17 @@ describe('Item regularize path', () => {
expect(url.hash).toContain('/summary'); expect(url.hash).toContain('/summary');
}); });
it('should regularize the item', async() => { it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenu)
.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton)
.waitToGetProperty(`${selectors.itemDescriptor.regularizeWarehouseAutocomplete} input`, 'value');
expect(result).toEqual('Warehouse Four');
});
it('should regularize the item', async() => {
const result = await nightmare
.write(selectors.itemDescriptor.regularizeQuantityInput, 100) .write(selectors.itemDescriptor.regularizeQuantityInput, 100)
.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One') .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One')
.waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitToClick(selectors.itemDescriptor.regularizeSaveButton)
@ -51,6 +76,15 @@ describe('Item regularize path', () => {
expect(url.hash).toEqual('#!/ticket/index'); expect(url.hash).toEqual('#!/ticket/index');
}); });
it('should now clear the user local settings', async() => {
let result = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.waitToClick(selectors.globalItems.userConfigFirstAutocompleteClear)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should search for the ticket with alias missing', async() => { it('should search for the ticket with alias missing', async() => {
const result = await nightmare const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'missing') .write(selectors.ticketsIndex.searchTicketInput, 'missing')