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/bootstrap_linked_tabs_spec.js | |
parent | 5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff) |
Prettify all spec files
Diffstat (limited to 'spec/javascripts/bootstrap_linked_tabs_spec.js')
-rw-r--r-- | spec/javascripts/bootstrap_linked_tabs_spec.js | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/spec/javascripts/bootstrap_linked_tabs_spec.js b/spec/javascripts/bootstrap_linked_tabs_spec.js index 6f679369289..0bf6c9820fa 100644 --- a/spec/javascripts/bootstrap_linked_tabs_spec.js +++ b/spec/javascripts/bootstrap_linked_tabs_spec.js @@ -10,11 +10,12 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; describe('when is initialized', () => { beforeEach(() => { - spyOn(window.history, 'replaceState').and.callFake(function () {}); + spyOn(window.history, 'replaceState').and.callFake(function() {}); }); it('should activate the tab correspondent to the given action', () => { - const linkedTabs = new LinkedTabs({ // eslint-disable-line + const linkedTabs = new LinkedTabs({ + // eslint-disable-line action: 'tab1', defaultAction: 'tab1', parentEl: '.linked-tabs', @@ -24,7 +25,8 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; }); it('should active the default tab action when the action is show', () => { - const linkedTabs = new LinkedTabs({ // eslint-disable-line + const linkedTabs = new LinkedTabs({ + // eslint-disable-line action: 'show', defaultAction: 'tab1', parentEl: '.linked-tabs', @@ -45,14 +47,21 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; }); const secondTab = document.querySelector('.linked-tabs li:nth-child(2) a'); - const newState = secondTab.getAttribute('href') + linkedTabs.currentLocation.search + linkedTabs.currentLocation.hash; + const newState = + secondTab.getAttribute('href') + + linkedTabs.currentLocation.search + + linkedTabs.currentLocation.hash; secondTab.click(); if (historySpy) { - expect(historySpy).toHaveBeenCalledWith({ - url: newState, - }, document.title, newState); + expect(historySpy).toHaveBeenCalledWith( + { + url: newState, + }, + document.title, + newState, + ); } }); }); |