29 lines
847 B
JavaScript
29 lines
847 B
JavaScript
import './index.js';
|
|
import template from './index.html';
|
|
|
|
describe('Component vnChip', () => {
|
|
let $element;
|
|
let $scope;
|
|
let controller;
|
|
|
|
beforeEach(angular.mock.module('vnCore', $translateProvider => {
|
|
$translateProvider.translations('en', {});
|
|
}));
|
|
|
|
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
|
$scope = $rootScope.$new();
|
|
$element = angular.element(`<div>${template}</div>`);
|
|
controller = $componentController('vnChip', {$element, $scope, $transclude: () => {}});
|
|
}));
|
|
|
|
describe('remove()', () => {
|
|
it(`should call onRemove()`, () => {
|
|
controller.onRemove = () => {};
|
|
spyOn(controller, 'onRemove');
|
|
controller.remove();
|
|
|
|
expect(controller.onRemove).toHaveBeenCalledWith();
|
|
});
|
|
});
|
|
});
|