moved transferor from fiscal data to basic data + e2e
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e2ec78461a
commit
86631c84d0
|
@ -151,6 +151,7 @@ export default {
|
|||
mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
|
||||
salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
|
||||
transferor: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
|
||||
saveButton: 'vn-client-basic-data button[type=submit]'
|
||||
},
|
||||
clientFiscalData: {
|
||||
|
@ -162,7 +163,6 @@ export default {
|
|||
postcode: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.postcode"]',
|
||||
sageTax: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.sageTaxTypeFk"]',
|
||||
sageTransaction: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.sageTransactionTypeFk"]',
|
||||
transferor: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
|
||||
city: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.city"]',
|
||||
province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
|
||||
country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
||||
|
|
|
@ -34,6 +34,7 @@ describe('Client Edit basicData path', () => {
|
|||
await page.clearInput(selectors.clientBasicData.email);
|
||||
await page.write(selectors.clientBasicData.email, 'PWallace@verdnatura.es');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.channel, 'Rumors on the streets');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.transferor, 'Max Eisenhardt');
|
||||
await page.waitToClick(selectors.clientBasicData.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -67,6 +68,13 @@ describe('Client Edit basicData path', () => {
|
|||
|
||||
expect(result).toEqual('Rumors on the streets');
|
||||
});
|
||||
|
||||
it('should confirm the previous client have been selected', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.clientBasicData.transferor, 'value');
|
||||
|
||||
expect(result).toEqual('Max Eisenhardt');
|
||||
});
|
||||
});
|
||||
|
||||
describe('as salesAssistant', () => {
|
||||
|
|
|
@ -68,7 +68,6 @@ describe('Client Edit fiscalData path', () => {
|
|||
await page.write(selectors.clientFiscalData.city, 'Valencia');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.sageTax, 'operaciones no sujetas');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.sageTransaction, 'regularización de inversiones');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.transferor, 'Max Eisenhardt');
|
||||
await page.clearInput(selectors.clientFiscalData.postcode);
|
||||
await page.write(selectors.clientFiscalData.postcode, '46000');
|
||||
await page.waitToClick(selectors.clientFiscalData.activeCheckbox);
|
||||
|
@ -202,12 +201,6 @@ describe('Client Edit fiscalData path', () => {
|
|||
expect(result).toEqual('36: Regularización de inversiones');
|
||||
});
|
||||
|
||||
it('should confirm the transferor have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.transferor, 'value');
|
||||
|
||||
expect(result).toEqual('Max Eisenhardt');
|
||||
});
|
||||
|
||||
it('should confirm the city have been autocompleted', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');
|
||||
|
||||
|
|
|
@ -69,6 +69,19 @@
|
|||
label="Channel">
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
ng-model="$ctrl.client.transferorFk"
|
||||
url="Clients/isActive"
|
||||
search-function="$ctrl.transferorSearchFunction($search)"
|
||||
where="{id: {neq: $ctrl.client.id}}"
|
||||
show-field="name"
|
||||
value-field="id"
|
||||
label="Previous client"
|
||||
info="In case of a company succession, specify the grantor company"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
import ngModule from '../module';
|
||||
import Section from 'salix/components/section';
|
||||
|
||||
export default class Controller extends Section {
|
||||
transferorSearchFunction($search) {
|
||||
return /^\d+$/.test($search)
|
||||
? {id: $search}
|
||||
: {name: {like: '%' + $search + '%'}};
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnClientBasicData', {
|
||||
template: require('./index.html'),
|
||||
controller: Section,
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
client: '<'
|
||||
}
|
||||
|
|
|
@ -73,17 +73,6 @@
|
|||
rule>
|
||||
<tpl-item>{{id}}: {{transaction}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
ng-model="$ctrl.client.transferorFk"
|
||||
url="Clients/isActive"
|
||||
search-function="$ctrl.transferorSearchFunction($search)"
|
||||
where="{id: {neq: $ctrl.client.id}}"
|
||||
show-field="name"
|
||||
value-field="id"
|
||||
label="Previous client"
|
||||
info="In case of a company succession, specify the grantor company"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-datalist vn-one
|
||||
|
|
|
@ -173,12 +173,6 @@ export default class Controller extends Section {
|
|||
this.client.provinceFk = response.provinceFk;
|
||||
this.client.countryFk = response.countryFk;
|
||||
}
|
||||
|
||||
transferorSearchFunction($search) {
|
||||
return /^\d+$/.test($search)
|
||||
? {id: $search}
|
||||
: {name: {like: '%' + $search + '%'}};
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnClientFiscalData', {
|
||||
|
|
Loading…
Reference in New Issue