import './index.js';

describe('Component vnInputFile', () => {
    let $element;
    let $scope;
    let controller;

    beforeEach(ngModule('vnCore'));

    beforeEach(inject(($compile, $rootScope) => {
        $scope = $rootScope.$new();
        $element = $compile('<vn-input-file></vn-input-file>')($scope);
        controller = $element.controller('vnInputFile');
    }));

    afterAll(() => {
        $element.remove();
        $scope.$destroy();
    });

    describe('field() setter', () => {
        it(`should set an empty string as value when null value is set`, () => {
            controller.field = null;

            expect(controller.value).toBe('');
        });
    });
});