33 lines
824 B
JavaScript
33 lines
824 B
JavaScript
describe('Component vnDropDown', () => {
|
|
let $element;
|
|
let controller;
|
|
|
|
beforeEach(ngModule('vnCore'));
|
|
|
|
beforeEach(inject(($compile, $rootScope, $document) => {
|
|
$element = $compile(`<vn-drop-down></vn-drop-down>`)($rootScope);
|
|
$document.find('body').append($element);
|
|
controller = $element.controller('vnDropDown');
|
|
}));
|
|
|
|
afterEach(() => {
|
|
$element.remove();
|
|
});
|
|
|
|
describe('show() method', () => {
|
|
it(`should enable the show property`, () => {
|
|
controller.show();
|
|
|
|
expect(controller.shown).toEqual(true);
|
|
});
|
|
});
|
|
|
|
describe('hide() method', () => {
|
|
it(`should disable the show property`, () => {
|
|
controller.hide();
|
|
|
|
expect(controller.shown).toEqual(false);
|
|
});
|
|
});
|
|
});
|