salix/front/core/components/input-file/index.spec.js

29 lines
707 B
JavaScript
Raw Normal View History

import './index.js';
2019-06-07 11:07:23 +00:00
describe('Component vnInputFile', () => {
let $element;
2019-10-28 20:40:24 +00:00
let $scope;
let controller;
beforeEach(ngModule('vnCore'));
2019-10-28 20:40:24 +00:00
beforeEach(angular.mock.inject(($compile, $rootScope) => {
$scope = $rootScope.$new();
2019-10-28 20:40:24 +00:00
$element = $compile('<vn-input-file></vn-input-file>')($scope);
controller = $element.controller('vnInputFile');
}));
2019-10-28 20:40:24 +00:00
afterAll(() => {
$element.remove();
$scope.$destroy();
});
2019-10-28 20:40:24 +00:00
describe('field() setter', () => {
it(`should set an empty string as value when null value is set`, () => {
controller.field = null;
2019-10-28 20:40:24 +00:00
expect(controller.value).toBe('');
});
});
});