27 lines
748 B
JavaScript
27 lines
748 B
JavaScript
import './index.js';
|
|
import template from './index.html';
|
|
|
|
describe('Component vnChip', () => {
|
|
let $element;
|
|
let $scope;
|
|
let controller;
|
|
|
|
beforeEach(ngModule('vnCore'));
|
|
|
|
beforeEach(inject(($componentController, $rootScope) => {
|
|
$scope = $rootScope.$new();
|
|
$element = angular.element(`<div>${template}</div>`);
|
|
controller = $componentController('vnChip', {$element, $scope, $transclude: () => {}});
|
|
}));
|
|
|
|
describe('onRemove()', () => {
|
|
it(`should emit remove event`, () => {
|
|
controller.emit = () => {};
|
|
jest.spyOn(controller, 'emit');
|
|
controller.onRemove();
|
|
|
|
expect(controller.emit).toHaveBeenCalledWith('remove');
|
|
});
|
|
});
|
|
});
|