diff options
author | Evan Read <eread@gitlab.com> | 2020-10-06 03:42:35 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2020-10-06 03:42:35 +0300 |
commit | b84d6c397db31bc460678566326b706d197e5ffe (patch) | |
tree | 25e6877cf9d843b0773c1130a645176c968f6ba6 /spec | |
parent | 2d185784804a31a2a66de96def94c65543c0058b (diff) |
Upgrade Prettier library and fix warnings that result
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/default/components/collapsible_container_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/default/components/table_of_contents_list_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/shared/components/gl_icon_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/shared/dom_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/shared/toc_helper.js | 4 |
5 files changed, 11 insertions, 15 deletions
diff --git a/spec/frontend/default/components/collapsible_container_spec.js b/spec/frontend/default/components/collapsible_container_spec.js index 259cdf8c0..37289b20c 100644 --- a/spec/frontend/default/components/collapsible_container_spec.js +++ b/spec/frontend/default/components/collapsible_container_spec.js @@ -14,7 +14,7 @@ describe('frontend/default/components/collapsible_container', () => { beforeEach(() => { // jquery is not available in Jest yet so we need to mock this method - jest.spyOn(dom, 'getOuterHeight').mockImplementation(x => Number(x.dataset.testOuterHeight)); + jest.spyOn(dom, 'getOuterHeight').mockImplementation((x) => Number(x.dataset.testOuterHeight)); jest.useFakeTimers(); }); diff --git a/spec/frontend/default/components/table_of_contents_list_spec.js b/spec/frontend/default/components/table_of_contents_list_spec.js index bd93f22ef..17a14a752 100644 --- a/spec/frontend/default/components/table_of_contents_list_spec.js +++ b/spec/frontend/default/components/table_of_contents_list_spec.js @@ -36,11 +36,7 @@ describe('frontend/default/components/table_of_contents_list', () => { }); it('starts at level 0', () => { - expect( - findLinks() - .at(0) - .classes('toc-level-0'), - ).toBe(true); + expect(findLinks().at(0).classes('toc-level-0')).toBe(true); }); }); @@ -77,7 +73,7 @@ describe('frontend/default/components/table_of_contents_list', () => { const data = findLinks().wrappers.reduce( (acc, link) => Object.assign(acc, { - [link.text()]: link.classes().find(x => x.startsWith('toc-level')), + [link.text()]: link.classes().find((x) => x.startsWith('toc-level')), }), {}, ); @@ -109,7 +105,7 @@ describe('frontend/default/components/table_of_contents_list', () => { }); it('has separator class for separator item', () => { - const data = findListItems().wrappers.map(x => ({ + const data = findListItems().wrappers.map((x) => ({ text: x.text(), hasSeparator: x.classes('toc-separator'), })); diff --git a/spec/frontend/shared/components/gl_icon_spec.js b/spec/frontend/shared/components/gl_icon_spec.js index 603fafefb..968c3251f 100644 --- a/spec/frontend/shared/components/gl_icon_spec.js +++ b/spec/frontend/shared/components/gl_icon_spec.js @@ -14,7 +14,7 @@ describe('GlIcon component', () => { let wrapper; let consoleSpy; - const createComponent = props => { + const createComponent = (props) => { wrapper = shallowMount(GlIcon, { propsData: { size: TEST_SIZE, @@ -25,8 +25,8 @@ describe('GlIcon component', () => { }); }; - const validateSize = size => GlIcon.props.size.validator(size); - const validateName = name => GlIcon.props.name.validator(name); + const validateSize = (size) => GlIcon.props.size.validator(size); + const validateName = (name) => GlIcon.props.name.validator(name); afterEach(() => { wrapper.destroy(); diff --git a/spec/frontend/shared/dom_spec.js b/spec/frontend/shared/dom_spec.js index ceb097080..aa09820f6 100644 --- a/spec/frontend/shared/dom_spec.js +++ b/spec/frontend/shared/dom_spec.js @@ -1,10 +1,10 @@ import { findChildByTagName } from '../../../content/frontend/shared/dom'; describe('frontend/shared/dom', () => { - const createElementWithChildren = children => { + const createElementWithChildren = (children) => { const el = document.createElement('div'); - children.forEach(tag => { + children.forEach((tag) => { const child = document.createElement(tag); el.appendChild(child); }); diff --git a/spec/frontend/shared/toc_helper.js b/spec/frontend/shared/toc_helper.js index 574f1d17d..5de505e8d 100644 --- a/spec/frontend/shared/toc_helper.js +++ b/spec/frontend/shared/toc_helper.js @@ -5,7 +5,7 @@ export const createItem = (text, items = []) => ({ items, }); -export const buildHTML = list => +export const buildHTML = (list) => list .map( ({ text, href, id, items }) => @@ -16,7 +16,7 @@ ${items?.length ? `<ul>${buildHTML(items)}</ul>` : ''} ) .join(''); -export const createTOCElement = list => { +export const createTOCElement = (list) => { const ul = document.createElement('ul'); ul.innerHTML = buildHTML(list); return ul; |