Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
This commit is contained in:
commit
2e81a86b05
|
@ -0,0 +1,92 @@
|
||||||
|
import selectors from '../../helpers/selectors.js';
|
||||||
|
import createNightmare from '../../helpers/nightmare';
|
||||||
|
|
||||||
|
fdescribe('Order Edit basicData path', () => {
|
||||||
|
const nightmare = createNightmare();
|
||||||
|
describe('when confirmed order', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
nightmare
|
||||||
|
.loginAndModule('employee', 'order')
|
||||||
|
.accessToSearchResult('1')
|
||||||
|
.accessToSection('order.card.basicData');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not be able to change the client', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark')
|
||||||
|
.click(selectors.orderBasicData.saveButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when order with rows', () => {
|
||||||
|
it('should now navigate to order index', async() => {
|
||||||
|
const url = await nightmare
|
||||||
|
.waitToClick(selectors.globalItems.returnToModuleIndexButton)
|
||||||
|
.waitToClick(selectors.globalItems.acceptVnConfirm)
|
||||||
|
.wait(selectors.ordersIndex.createOrderButton)
|
||||||
|
.accessToSearchResult('16')
|
||||||
|
.accessToSection('order.card.basicData')
|
||||||
|
.wait(selectors.orderBasicData.companyAutocomplete)
|
||||||
|
.parsedUrl();
|
||||||
|
|
||||||
|
expect(url.hash).toEqual('#!/order/16/basic-data');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not be able to change the company', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs')
|
||||||
|
.click(selectors.orderBasicData.saveButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when new order', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
nightmare
|
||||||
|
.loginAndModule('employee', 'order')
|
||||||
|
.accessToSearchResult('18')
|
||||||
|
.accessToSection('order.card.basicData');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be able to modify all the properties', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark')
|
||||||
|
.autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs')
|
||||||
|
.clearInput(selectors.orderBasicData.observationInput)
|
||||||
|
.type(selectors.orderBasicData.observationInput, 'Observation modified')
|
||||||
|
.click(selectors.orderBasicData.saveButton)
|
||||||
|
.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should now confirm the client have been edited', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.click(selectors.orderCatalog.catalogButton)
|
||||||
|
.wait(selectors.orderCatalog.orderByAutocomplete)
|
||||||
|
.click(selectors.orderBasicData.basicDataButton)
|
||||||
|
.waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value');
|
||||||
|
|
||||||
|
expect(result).toEqual('104: Tony Stark');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should now confirm the comany have been edited', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToGetProperty(`${selectors.orderBasicData.companyAutocomplete} input`, 'value');
|
||||||
|
|
||||||
|
expect(result).toEqual('CCs');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should now confirm the observations have been edited', async() => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToGetProperty(selectors.orderBasicData.observationInput, 'value');
|
||||||
|
|
||||||
|
expect(result).toEqual('Observation modified');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -60,5 +60,7 @@
|
||||||
"You must delete the claim id %d first": "Antes debes borrar la reclamacion %d",
|
"You must delete the claim id %d first": "Antes debes borrar la reclamacion %d",
|
||||||
"You don't have enough privileges": "You don't have enough privileges",
|
"You don't have enough privileges": "You don't have enough privileges",
|
||||||
"Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo",
|
"Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo",
|
||||||
"Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF"
|
"Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF",
|
||||||
|
"You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos",
|
||||||
|
"INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ"
|
||||||
}
|
}
|
|
@ -10,7 +10,6 @@
|
||||||
<vn-title>Basic data</vn-title>
|
<vn-title>Basic data</vn-title>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
disabled="$ctrl.order.rows.length || $ctrl.order.isConfirmed"
|
|
||||||
vn-one
|
vn-one
|
||||||
url="/api/Clients"
|
url="/api/Clients"
|
||||||
label="Client"
|
label="Client"
|
||||||
|
@ -22,7 +21,6 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
disabled="$ctrl.order.rows.length || $ctrl.order.isConfirmed"
|
|
||||||
url="/api/Companies"
|
url="/api/Companies"
|
||||||
label="Company"
|
label="Company"
|
||||||
show-field="code"
|
show-field="code"
|
||||||
|
@ -31,7 +29,6 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-date-picker
|
<vn-date-picker
|
||||||
vn-one
|
vn-one
|
||||||
disabled="$ctrl.order.rows.length || $ctrl.order.isConfirmed"
|
|
||||||
label="Landed"
|
label="Landed"
|
||||||
model="$ctrl.order.landed"
|
model="$ctrl.order.landed"
|
||||||
ini-options="{enableTime: false}">
|
ini-options="{enableTime: false}">
|
||||||
|
@ -40,16 +37,12 @@
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textarea
|
<vn-textarea
|
||||||
vn-three
|
vn-three
|
||||||
disabled="$ctrl.order.rows.length || $ctrl.order.isConfirmed"
|
|
||||||
label="Observation"
|
label="Observation"
|
||||||
field="$ctrl.order.note">
|
field="$ctrl.order.note">
|
||||||
</vn-textarea>
|
</vn-textarea>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal ng-if="$ctrl.order.rows.length|| $ctrl.order.isConfirmed" class="disabledForm">
|
|
||||||
<span class="disabled" translate>This form has been disabled because there are lines in this order or it's confirmed</span>
|
|
||||||
</vn-horizontal>
|
|
||||||
</vn-card>
|
</vn-card>
|
||||||
<vn-button-bar>
|
<vn-button-bar>
|
||||||
<vn-submit disabled="$ctrl.order.rows.length || $ctrl.order.isConfirmed" label="Save"></vn-submit>
|
<vn-submit label="Save"></vn-submit>
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue