fix tests in droplab/hook_spec.js

This commit is contained in:
Mike Greiling 2018-04-13 17:19:09 -05:00
parent 5e4d02ba83
commit 00fc61cf11
No known key found for this signature in database
GPG key ID: 0303DF507FA67596

View file

@ -1,5 +1,4 @@
import Hook from '~/droplab/hook'; import Hook from '~/droplab/hook';
import * as dropdownSrc from '~/droplab/drop_down';
describe('Hook', function () { describe('Hook', function () {
describe('class constructor', function () { describe('class constructor', function () {
@ -10,7 +9,7 @@ describe('Hook', function () {
this.config = {}; this.config = {};
this.dropdown = {}; this.dropdown = {};
spyOn(dropdownSrc, 'default').and.returnValue(this.dropdown); this.dropdownConstructor = spyOnDependency(Hook, 'DropDown').and.returnValue(this.dropdown);
this.hook = new Hook(this.trigger, this.list, this.plugins, this.config); this.hook = new Hook(this.trigger, this.list, this.plugins, this.config);
}); });
@ -24,7 +23,7 @@ describe('Hook', function () {
}); });
it('should call DropDown constructor', function () { it('should call DropDown constructor', function () {
expect(dropdownSrc.default).toHaveBeenCalledWith(this.list, this.config); expect(this.dropdownConstructor).toHaveBeenCalledWith(this.list, this.config);
}); });
it('should set .type', function () { it('should set .type', function () {