salix/front/core/components/drop-down/drop-down.spec.js

35 lines
917 B
JavaScript
Raw Normal View History

describe('Component vnDropDown', () => {
let $element;
2018-11-06 13:27:16 +00:00
let controller;
2019-09-13 14:09:14 +00:00
beforeEach(angular.mock.module('vnCore', $translateProvider => {
$translateProvider.translations('en', {});
}));
2018-03-09 13:15:30 +00:00
2018-10-18 18:48:21 +00:00
beforeEach(inject(($compile, $rootScope, $document) => {
$element = $compile(`<vn-drop-down></vn-drop-down>`)($rootScope);
$document.find('body').append($element);
2018-11-06 13:27:16 +00:00
controller = $element.controller('vnDropDown');
}));
2018-10-18 18:48:21 +00:00
afterEach(() => {
$element.remove();
});
2018-03-09 13:15:30 +00:00
describe('show() method', () => {
2018-10-18 18:48:21 +00:00
it(`should enable the show property`, () => {
2018-11-06 13:27:16 +00:00
controller.show();
2018-11-06 13:27:16 +00:00
expect(controller.shown).toEqual(true);
});
});
2018-03-09 13:15:30 +00:00
describe('hide() method', () => {
2018-10-18 18:48:21 +00:00
it(`should disable the show property`, () => {
2018-11-06 13:27:16 +00:00
controller.hide();
2017-10-13 08:23:28 +00:00
2018-11-06 13:27:16 +00:00
expect(controller.shown).toEqual(false);
2017-10-13 08:23:28 +00:00
});
});
});