Fixed test
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
29ca6c52af
commit
d5e53909c6
|
@ -11,7 +11,7 @@ describe('Supplier Component vnSupplierAccount', () => {
|
|||
$httpBackend = _$httpBackend_;
|
||||
$scope = $rootScope.$new();
|
||||
$scope.bankEntity = {
|
||||
show: () => {}
|
||||
open: () => {}
|
||||
};
|
||||
$element = angular.element('<vn-supplier-accounts></supplier-accounts>');
|
||||
controller = $componentController('vnSupplierAccount', {$element, $scope});
|
||||
|
@ -28,26 +28,27 @@ describe('Supplier Component vnSupplierAccount', () => {
|
|||
preventDefault: () => {}
|
||||
};
|
||||
jest.spyOn(event, 'preventDefault');
|
||||
jest.spyOn(controller.$.bankEntity, 'show');
|
||||
jest.spyOn(controller.$.bankEntity, 'open');
|
||||
|
||||
controller.showBankEntity(event);
|
||||
|
||||
expect(event.preventDefault).not.toHaveBeenCalledWith();
|
||||
expect(controller.$.bankEntity.show).not.toHaveBeenCalledWith();
|
||||
expect(controller.$.bankEntity.open).not.toHaveBeenCalledWith();
|
||||
});
|
||||
|
||||
it('should call preventDefault() and show() when the default is not prevented', () => {
|
||||
it('should call preventDefault() and open() when the default is not prevented', () => {
|
||||
const event = {
|
||||
defaultPrevented: false,
|
||||
preventDefault: () => {}
|
||||
};
|
||||
|
||||
jest.spyOn(event, 'preventDefault');
|
||||
jest.spyOn(controller.$.bankEntity, 'show');
|
||||
jest.spyOn(controller.$.bankEntity, 'open');
|
||||
|
||||
controller.showBankEntity(event);
|
||||
|
||||
expect(event.preventDefault).toHaveBeenCalledWith();
|
||||
expect(controller.$.bankEntity.show).toHaveBeenCalledWith();
|
||||
expect(controller.$.bankEntity.open).toHaveBeenCalledWith();
|
||||
});
|
||||
|
||||
it('should request to create a new bank entity', () => {
|
||||
|
|
Loading…
Reference in New Issue