diff options
Diffstat (limited to 'spec/javascripts/droplab/hook_spec.js')
-rw-r--r-- | spec/javascripts/droplab/hook_spec.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/javascripts/droplab/hook_spec.js b/spec/javascripts/droplab/hook_spec.js index 5eed1db2750..40470436f19 100644 --- a/spec/javascripts/droplab/hook_spec.js +++ b/spec/javascripts/droplab/hook_spec.js @@ -1,8 +1,8 @@ import Hook from '~/droplab/hook'; -describe('Hook', function () { - describe('class constructor', function () { - beforeEach(function () { +describe('Hook', function() { + describe('class constructor', function() { + beforeEach(function() { this.trigger = { id: 'id' }; this.list = {}; this.plugins = {}; @@ -14,58 +14,58 @@ describe('Hook', function () { this.hook = new Hook(this.trigger, this.list, this.plugins, this.config); }); - it('should set .trigger', function () { + it('should set .trigger', function() { expect(this.hook.trigger).toBe(this.trigger); }); - it('should set .list', function () { + it('should set .list', function() { expect(this.hook.list).toBe(this.dropdown); }); - it('should call DropDown constructor', function () { + it('should call DropDown constructor', function() { expect(this.dropdownConstructor).toHaveBeenCalledWith(this.list, this.config); }); - it('should set .type', function () { + it('should set .type', function() { expect(this.hook.type).toBe('Hook'); }); - it('should set .event', function () { + it('should set .event', function() { expect(this.hook.event).toBe('click'); }); - it('should set .plugins', function () { + it('should set .plugins', function() { expect(this.hook.plugins).toBe(this.plugins); }); - it('should set .config', function () { + it('should set .config', function() { expect(this.hook.config).toBe(this.config); }); - it('should set .id', function () { + it('should set .id', function() { expect(this.hook.id).toBe(this.trigger.id); }); - describe('if config argument is undefined', function () { - beforeEach(function () { + describe('if config argument is undefined', function() { + beforeEach(function() { this.config = undefined; this.hook = new Hook(this.trigger, this.list, this.plugins, this.config); }); - it('should set .config to an empty object', function () { + it('should set .config to an empty object', function() { expect(this.hook.config).toEqual({}); }); }); - describe('if plugins argument is undefined', function () { - beforeEach(function () { + describe('if plugins argument is undefined', function() { + beforeEach(function() { this.plugins = undefined; this.hook = new Hook(this.trigger, this.list, this.plugins, this.config); }); - it('should set .plugins to an empty array', function () { + it('should set .plugins to an empty array', function() { expect(this.hook.plugins).toEqual([]); }); }); |