create client path now adds a sales person

This commit is contained in:
Carlos Jimenez 2017-12-11 08:51:48 +01:00
parent c51d339732
commit 934a1bff49
2 changed files with 17 additions and 0 deletions

View File

@ -31,6 +31,8 @@ export default {
socialName: `${components.vnTextfield}[name="socialName"]`,
userName: `${components.vnTextfield}[name="userName"]`,
email: `${components.vnTextfield}[name="email"]`,
salesPersonInput: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > ${components.vnTextfield}`,
salesBruceBannerOption: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`,
createButton: `${components.vnSubmit}`
},
basicData: {

View File

@ -179,6 +179,21 @@ describe('create client path', () => {
.catch(catchErrors(done));
});
it('should receive an error when clicking the create button having all the form fields empty but sales person', done => {
nightmare
.waitToClick(selectors.createClientView.salesPersonInput)
.waitToClick(selectors.createClientView.salesBruceBannerOption)
.wait(200)
.click(selectors.createClientView.createButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
.then(result => {
expect(result).toContain(`Error: La instancia`);
done();
})
.catch(catchErrors(done));
});
it(`should create a new user with all it's data`, done => {
nightmare
.waitForSnackbarReset()