salix/front/core/components/chip/index.spec.js

27 lines
754 B
JavaScript
Raw Normal View History

2018-09-07 10:20:57 +00:00
import './index.js';
import template from './index.html';
describe('Component vnChip', () => {
let $element;
let $scope;
let controller;
beforeEach(ngModule('vnCore'));
2018-09-07 10:20:57 +00:00
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
2018-09-07 10:20:57 +00:00
$scope = $rootScope.$new();
$element = angular.element(`<div>${template}</div>`);
controller = $componentController('vnChip', {$element, $scope, $transclude: () => {}});
2018-09-07 10:20:57 +00:00
}));
describe('remove()', () => {
it(`should call onRemove()`, () => {
controller.onRemove = () => {};
spyOn(controller, 'onRemove');
controller.remove();
expect(controller.onRemove).toHaveBeenCalledWith();
});
});
});