diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-10-17 10:13:26 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-17 19:18:17 +0300 |
commit | f666026d71ebefd70219d5078b1f0c83fa01f84d (patch) | |
tree | ce43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/comment_type_toggle_spec.js | |
parent | 5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff) |
Prettify all spec files
Diffstat (limited to 'spec/javascripts/comment_type_toggle_spec.js')
-rw-r--r-- | spec/javascripts/comment_type_toggle_spec.js | 114 |
1 files changed, 63 insertions, 51 deletions
diff --git a/spec/javascripts/comment_type_toggle_spec.js b/spec/javascripts/comment_type_toggle_spec.js index 0ba709298c5..8b1217a000f 100644 --- a/spec/javascripts/comment_type_toggle_spec.js +++ b/spec/javascripts/comment_type_toggle_spec.js @@ -1,9 +1,9 @@ import CommentTypeToggle from '~/comment_type_toggle'; import InputSetter from '~/droplab/plugins/input_setter'; -describe('CommentTypeToggle', function () { - describe('class constructor', function () { - beforeEach(function () { +describe('CommentTypeToggle', function() { + describe('class constructor', function() { + beforeEach(function() { this.dropdownTrigger = {}; this.dropdownList = {}; this.noteTypeInput = {}; @@ -19,33 +19,33 @@ describe('CommentTypeToggle', function () { }); }); - it('should set .dropdownTrigger', function () { + it('should set .dropdownTrigger', function() { expect(this.commentTypeToggle.dropdownTrigger).toBe(this.dropdownTrigger); }); - it('should set .dropdownList', function () { + it('should set .dropdownList', function() { expect(this.commentTypeToggle.dropdownList).toBe(this.dropdownList); }); - it('should set .noteTypeInput', function () { + it('should set .noteTypeInput', function() { expect(this.commentTypeToggle.noteTypeInput).toBe(this.noteTypeInput); }); - it('should set .submitButton', function () { + it('should set .submitButton', function() { expect(this.commentTypeToggle.submitButton).toBe(this.submitButton); }); - it('should set .closeButton', function () { + it('should set .closeButton', function() { expect(this.commentTypeToggle.closeButton).toBe(this.closeButton); }); - it('should set .reopenButton', function () { + it('should set .reopenButton', function() { expect(this.commentTypeToggle.reopenButton).toBe(this.reopenButton); }); }); - describe('initDroplab', function () { - beforeEach(function () { + describe('initDroplab', function() { + beforeEach(function() { this.commentTypeToggle = { dropdownTrigger: {}, dropdownList: {}, @@ -58,25 +58,27 @@ describe('CommentTypeToggle', function () { this.droplab = jasmine.createSpyObj('droplab', ['init']); - this.droplabConstructor = spyOnDependency(CommentTypeToggle, 'DropLab').and.returnValue(this.droplab); + this.droplabConstructor = spyOnDependency(CommentTypeToggle, 'DropLab').and.returnValue( + this.droplab, + ); spyOn(this.commentTypeToggle, 'setConfig').and.returnValue(this.config); CommentTypeToggle.prototype.initDroplab.call(this.commentTypeToggle); }); - it('should instantiate a DropLab instance', function () { + it('should instantiate a DropLab instance', function() { expect(this.droplabConstructor).toHaveBeenCalled(); }); - it('should set .droplab', function () { + it('should set .droplab', function() { expect(this.commentTypeToggle.droplab).toBe(this.droplab); }); - it('should call .setConfig', function () { + it('should call .setConfig', function() { expect(this.commentTypeToggle.setConfig).toHaveBeenCalled(); }); - it('should call DropLab.prototype.init', function () { + it('should call DropLab.prototype.init', function() { expect(this.droplab.init).toHaveBeenCalledWith( this.commentTypeToggle.dropdownTrigger, this.commentTypeToggle.dropdownList, @@ -86,9 +88,9 @@ describe('CommentTypeToggle', function () { }); }); - describe('setConfig', function () { - describe('if no .closeButton is provided', function () { - beforeEach(function () { + describe('setConfig', function() { + describe('if no .closeButton is provided', function() { + beforeEach(function() { this.commentTypeToggle = { dropdownTrigger: {}, dropdownList: {}, @@ -100,28 +102,33 @@ describe('CommentTypeToggle', function () { this.setConfig = CommentTypeToggle.prototype.setConfig.call(this.commentTypeToggle); }); - it('should not add .closeButton related InputSetter config', function () { + it('should not add .closeButton related InputSetter config', function() { expect(this.setConfig).toEqual({ - InputSetter: [{ - input: this.commentTypeToggle.noteTypeInput, - valueAttribute: 'data-value', - }, { - input: this.commentTypeToggle.submitButton, - valueAttribute: 'data-submit-text', - }, { - input: this.commentTypeToggle.reopenButton, - valueAttribute: 'data-reopen-text', - }, { - input: this.commentTypeToggle.reopenButton, - valueAttribute: 'data-reopen-text', - inputAttribute: 'data-alternative-text', - }], + InputSetter: [ + { + input: this.commentTypeToggle.noteTypeInput, + valueAttribute: 'data-value', + }, + { + input: this.commentTypeToggle.submitButton, + valueAttribute: 'data-submit-text', + }, + { + input: this.commentTypeToggle.reopenButton, + valueAttribute: 'data-reopen-text', + }, + { + input: this.commentTypeToggle.reopenButton, + valueAttribute: 'data-reopen-text', + inputAttribute: 'data-alternative-text', + }, + ], }); }); }); - describe('if no .reopenButton is provided', function () { - beforeEach(function () { + describe('if no .reopenButton is provided', function() { + beforeEach(function() { this.commentTypeToggle = { dropdownTrigger: {}, dropdownList: {}, @@ -133,22 +140,27 @@ describe('CommentTypeToggle', function () { this.setConfig = CommentTypeToggle.prototype.setConfig.call(this.commentTypeToggle); }); - it('should not add .reopenButton related InputSetter config', function () { + it('should not add .reopenButton related InputSetter config', function() { expect(this.setConfig).toEqual({ - InputSetter: [{ - input: this.commentTypeToggle.noteTypeInput, - valueAttribute: 'data-value', - }, { - input: this.commentTypeToggle.submitButton, - valueAttribute: 'data-submit-text', - }, { - input: this.commentTypeToggle.closeButton, - valueAttribute: 'data-close-text', - }, { - input: this.commentTypeToggle.closeButton, - valueAttribute: 'data-close-text', - inputAttribute: 'data-alternative-text', - }], + InputSetter: [ + { + input: this.commentTypeToggle.noteTypeInput, + valueAttribute: 'data-value', + }, + { + input: this.commentTypeToggle.submitButton, + valueAttribute: 'data-submit-text', + }, + { + input: this.commentTypeToggle.closeButton, + valueAttribute: 'data-close-text', + }, + { + input: this.commentTypeToggle.closeButton, + valueAttribute: 'data-close-text', + inputAttribute: 'data-alternative-text', + }, + ], }); }); }); |