#1691 item.basicData - Añadir campo hasKgPrice

This commit is contained in:
Bernat 2019-09-18 11:11:47 +02:00
parent d66d2f16c0
commit 7af4f3626d
4 changed files with 15 additions and 0 deletions

View File

@ -237,6 +237,7 @@ export default {
expenceAutocomplete: 'vn-autocomplete[field="$ctrl.item.expenceFk"]', expenceAutocomplete: 'vn-autocomplete[field="$ctrl.item.expenceFk"]',
longNameInput: 'vn-textfield[field="$ctrl.item.longName"] input', longNameInput: 'vn-textfield[field="$ctrl.item.longName"] input',
isActiveCheckbox: 'vn-check[label="Active"] md-checkbox', isActiveCheckbox: 'vn-check[label="Active"] md-checkbox',
priceInKgCheckbox: 'vn-check[label="Price in kg"] md-checkbox',
submitBasicDataButton: `${components.vnSubmit}` submitBasicDataButton: `${components.vnSubmit}`
}, },
itemTags: { itemTags: {

View File

@ -31,6 +31,7 @@ describe('Item Edit basic data path', () => {
.clearInput(selectors.itemBasicData.longNameInput) .clearInput(selectors.itemBasicData.longNameInput)
.write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity') .write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
.waitToClick(selectors.itemBasicData.isActiveCheckbox) .waitToClick(selectors.itemBasicData.isActiveCheckbox)
.waitToClick(selectors.itemBasicData.priceInKgCheckbox)
.waitToClick(selectors.itemBasicData.submitBasicDataButton) .waitToClick(selectors.itemBasicData.submitBasicDataButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -93,4 +94,11 @@ describe('Item Edit basic data path', () => {
expect(result).toBe('unchecked'); expect(result).toBe('unchecked');
}); });
it('should confirm the priceInKg checkbox is checked', async() => {
const result = await nightmare
.checkboxState(selectors.itemBasicData.priceInKgCheckbox);
expect(result).toBe('checked');
});
}); });

View File

@ -87,6 +87,11 @@
vn-one vn-one
label="Active" label="Active"
field="$ctrl.item.isActive"> field="$ctrl.item.isActive">
</vn-check>
<vn-check
vn-one
label="Price in kg"
field="$ctrl.item.hasKgPrice">
</vn-check> </vn-check>
<vn-textarea vn-one label="description" field="$ctrl.item.description"></vn-textarea> <vn-textarea vn-one label="description" field="$ctrl.item.description"></vn-textarea>
</vn-horizontal> </vn-horizontal>

View File

@ -5,3 +5,4 @@ Full name calculates based on tags 1-3. Is not recommended to change it manually
No se recomienda cambiarlo manualmente No se recomienda cambiarlo manualmente
Is active: Activo Is active: Activo
Expence: Gasto Expence: Gasto
Price in kg: Precio en kg