This commit is contained in:
parent
75fba75688
commit
6bb4f04bd1
|
@ -87,6 +87,7 @@ export default {
|
|||
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
|
||||
newBankEntityName: 'vn-client-billing-data > vn-dialog vn-textfield[label="Name"] input',
|
||||
newBankEntityBIC: 'vn-client-billing-data > vn-dialog vn-textfield[label="Swift / BIC"] input',
|
||||
newBankEntityCode: 'vn-client-billing-data > vn-dialog vn-textfield[label="Code"] input',
|
||||
acceptBankEntityButton: 'vn-client-billing-data > vn-dialog button[response="ACCEPT"]',
|
||||
saveButton: `${components.vnSubmit}`
|
||||
},
|
||||
|
|
|
@ -44,6 +44,7 @@ describe('Client Edit pay method path', () => {
|
|||
const newcode = await nightmare
|
||||
.waitToClick(selectors.clientPayMethod.newBankEntityButton)
|
||||
.write(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank')
|
||||
.write(selectors.clientPayMethod.newBankEntityCode, 999)
|
||||
.write(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT')
|
||||
.waitToClick(selectors.clientPayMethod.acceptBankEntityButton)
|
||||
.waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value');
|
||||
|
|
|
@ -51,7 +51,8 @@ describe('Client', () => {
|
|||
controller.newBankEntity = {
|
||||
name: '',
|
||||
bic: 'ES123',
|
||||
countryFk: 1
|
||||
countryFk: 1,
|
||||
id: 999
|
||||
};
|
||||
controller.onBankEntityResponse('ACCEPT');
|
||||
|
||||
|
@ -62,18 +63,32 @@ describe('Client', () => {
|
|||
controller.newBankEntity = {
|
||||
name: 'My new bank entity',
|
||||
bic: '',
|
||||
countryFk: 1
|
||||
countryFk: 1,
|
||||
id: 999
|
||||
};
|
||||
controller.onBankEntityResponse('ACCEPT');
|
||||
|
||||
expect(vnApp.showError).toHaveBeenCalledWith(`Swift / BIC can't be empty`);
|
||||
});
|
||||
|
||||
it(`should throw an error if id property is empty`, () => {
|
||||
controller.newBankEntity = {
|
||||
name: 'My new bank entity',
|
||||
bic: 'ES123',
|
||||
countryFk: 1,
|
||||
id: null
|
||||
};
|
||||
controller.onBankEntityResponse('ACCEPT');
|
||||
|
||||
expect(vnApp.showError).toHaveBeenCalledWith(`Code can't be empty`);
|
||||
});
|
||||
|
||||
it('should request to create a new bank entity', () => {
|
||||
let newBankEntity = {
|
||||
name: 'My new bank entity',
|
||||
bic: 'ES123',
|
||||
countryFk: 1
|
||||
countryFk: 1,
|
||||
id: 999
|
||||
};
|
||||
controller.newBankEntity = newBankEntity;
|
||||
$httpBackend.when('POST', '/client/api/BankEntities').respond('done');
|
||||
|
|
Loading…
Reference in New Issue