Commit 7cfe360c authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 32 files - 54 of 73

Part of our prettier migration; changing the arrow-parens style.
parent dc6c2412
......@@ -1706,41 +1706,6 @@ spec/frontend/behaviors/markdown/paste_markdown_table_spec.js
spec/frontend/behaviors/quick_submit_spec.js
spec/frontend/behaviors/secret_values_spec.js
## eager-lamport
spec/frontend/behaviors/shortcuts/keybindings_spec.js
spec/frontend/behaviors/shortcuts/shortcuts_issuable_spec.js
spec/frontend/blob/components/blob_content_error_spec.js
spec/frontend/blob/components/blob_edit_content_spec.js
spec/frontend/blob/components/blob_edit_header_spec.js
spec/frontend/blob/components/blob_header_spec.js
spec/frontend/blob/sketch/index_spec.js
spec/frontend/blob/utils_spec.js
spec/frontend/blob/viewer/index_spec.js
spec/frontend/blob_edit/edit_blob_spec.js
spec/frontend/boards/board_list_new_spec.js
spec/frontend/boards/board_list_spec.js
spec/frontend/boards/boards_store_spec.js
spec/frontend/boards/components/board_assignee_dropdown_spec.js
spec/frontend/boards/components/board_card_layout_spec.js
spec/frontend/boards/components/board_card_spec.js
spec/frontend/boards/components/board_configuration_options_spec.js
spec/frontend/boards/components/board_list_header_new_spec.js
spec/frontend/boards/components/board_list_header_spec.js
spec/frontend/boards/components/boards_selector_spec.js
spec/frontend/boards/components/issue_count_spec.js
spec/frontend/boards/components/issue_due_date_spec.js
spec/frontend/boards/components/issue_time_estimate_deprecated_spec.js
spec/frontend/boards/components/issue_time_estimate_spec.js
spec/frontend/boards/components/sidebar/board_sidebar_subscription_spec.js
spec/frontend/boards/components/sidebar/remove_issue_spec.js
spec/frontend/boards/issue_card_deprecated_spec.js
spec/frontend/boards/issue_card_inner_spec.js
spec/frontend/boards/list_spec.js
spec/frontend/boards/mock_data.js
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/getters_spec.js
spec/frontend/boards/stores/mutations_spec.js
## busy-mayer
spec/frontend/branches/branches_delete_modal_spec.js
spec/frontend/ci_settings_pipeline_triggers/components/triggers_list_spec.js
......
......@@ -9,7 +9,7 @@ describe('~/behaviors/shortcuts/keybindings.js', () => {
useLocalStorageSpy();
});
const setupCustomizations = async customizationsAsString => {
const setupCustomizations = async (customizationsAsString) => {
localStorage.clear();
if (customizationsAsString) {
......
......@@ -15,7 +15,7 @@ describe('ShortcutsIssuable', () => {
preloadFixtures(snippetShowFixtureName, mrShowFixtureName);
beforeAll(done => {
beforeAll((done) => {
initCopyAsGFM();
// Fake call to nodeToGfm so the import of lazy bundle happened
......@@ -81,7 +81,7 @@ describe('ShortcutsIssuable', () => {
stubSelection('<p>Selected text.</p>');
});
it('leaves existing input intact', done => {
it('leaves existing input intact', (done) => {
$(FORM_SELECTOR).val('This text was already here.');
expect($(FORM_SELECTOR).val()).toBe('This text was already here.');
......@@ -96,7 +96,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `input`', done => {
it('triggers `input`', (done) => {
let triggered = false;
$(FORM_SELECTOR).on('input', () => {
triggered = true;
......@@ -110,7 +110,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -122,7 +122,7 @@ describe('ShortcutsIssuable', () => {
});
describe('with a one-line selection', () => {
it('quotes the selection', done => {
it('quotes the selection', (done) => {
stubSelection('<p>This text has been selected.</p>');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -134,7 +134,7 @@ describe('ShortcutsIssuable', () => {
});
describe('with a multi-line selection', () => {
it('quotes the selected lines as a group', done => {
it('quotes the selected lines as a group', (done) => {
stubSelection(
'<p>Selected line one.</p>\n<p>Selected line two.</p>\n<p>Selected line three.</p>',
);
......@@ -154,7 +154,7 @@ describe('ShortcutsIssuable', () => {
stubSelection('<p>Selected text.</p>', true);
});
it('does not add anything to the input', done => {
it('does not add anything to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -163,7 +163,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -179,7 +179,7 @@ describe('ShortcutsIssuable', () => {
stubSelection('<div class="md">Selected text.</div><p>Invalid selected text.</p>', true);
});
it('only adds the valid part to the input', done => {
it('only adds the valid part to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -188,7 +188,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -198,7 +198,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `input`', done => {
it('triggers `input`', (done) => {
let triggered = false;
$(FORM_SELECTOR).on('input', () => {
triggered = true;
......@@ -233,7 +233,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('adds the quoted selection to the input', done => {
it('adds the quoted selection to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -242,7 +242,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -252,7 +252,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `input`', done => {
it('triggers `input`', (done) => {
let triggered = false;
$(FORM_SELECTOR).on('input', () => {
triggered = true;
......@@ -287,7 +287,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('does not add anything to the input', done => {
it('does not add anything to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -296,7 +296,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -308,7 +308,7 @@ describe('ShortcutsIssuable', () => {
});
describe('with a valid selection with no text content', () => {
it('returns the proper markdown', done => {
it('returns the proper markdown', (done) => {
stubSelection('<img src="https://gitlab.com/logo.png" alt="logo" />');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -334,7 +334,7 @@ describe('ShortcutsIssuable', () => {
'.sidebar-source-branch button',
);
[sidebarCollapsedBtn, sidebarExpandedBtn].forEach(btn => jest.spyOn(btn, 'click'));
[sidebarCollapsedBtn, sidebarExpandedBtn].forEach((btn) => jest.spyOn(btn, 'click'));
});
afterEach(() => {
......
......@@ -32,7 +32,7 @@ describe('Blob Content Error component', () => {
viewerError: error.id,
});
expect(wrapper.text()).toContain(reason);
options.forEach(option => {
options.forEach((option) => {
expect(wrapper.text()).toContain(option);
});
});
......@@ -52,7 +52,7 @@ describe('Blob Content Error component', () => {
},
});
expect(wrapper.text()).toContain(reason);
options.forEach(option => {
options.forEach((option) => {
expect(wrapper.text()).toContain(option);
});
});
......
......@@ -40,7 +40,7 @@ describe('Blob Header Editing', () => {
wrapper.destroy();
});
const triggerChangeContent = val => {
const triggerChangeContent = (val) => {
getValue.mockReturnValue(val);
const [cb] = onDidChangeModelContent.mock.calls[0];
......
......@@ -15,7 +15,7 @@ describe('Blob Header Editing', () => {
});
};
const findDeleteButton = () =>
wrapper.findAll(GlButton).wrappers.find(x => x.text() === 'Delete file');
wrapper.findAll(GlButton).wrappers.find((x) => x.text() === 'Delete file');
beforeEach(() => {
createComponent();
......
......@@ -75,7 +75,7 @@ describe('Blob Header Default Actions', () => {
expect(wrapper.find(DefaultActions).exists()).toBe(false);
});
Object.keys(slots).forEach(slot => {
Object.keys(slots).forEach((slot) => {
it('renders the slots', () => {
const slotContent = slots[slot];
createComponent(
......
......@@ -11,7 +11,7 @@ describe('Sketch viewer', () => {
});
describe('with error message', () => {
beforeEach(done => {
beforeEach((done) => {
jest.spyOn(SketchLoader.prototype, 'getZipFile').mockImplementation(
() =>
new Promise((resolve, reject) => {
......@@ -37,7 +37,7 @@ describe('Sketch viewer', () => {
});
describe('success', () => {
beforeEach(done => {
beforeEach((done) => {
const loadAsyncMock = {
files: {
'previews/preview.png': {
......@@ -48,7 +48,7 @@ describe('Sketch viewer', () => {
loadAsyncMock.files['previews/preview.png'].async.mockImplementation(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve('foo');
done();
}),
......
......@@ -26,7 +26,7 @@ describe('Blob utilities', () => {
it.each([[{}], [{ blobPath, blobContent, blobGlobalId }]])(
'creates the instance with the passed parameters %s',
extraParams => {
(extraParams) => {
const params = {
el: editorEl,
...extraParams,
......
......@@ -37,7 +37,7 @@ describe('Blob viewer', () => {
window.location.hash = '';
});
it('loads source file after switching views', done => {
it('loads source file after switching views', (done) => {
document.querySelector('.js-blob-viewer-switch-btn[data-viewer="simple"]').click();
setImmediate(() => {
......@@ -51,7 +51,7 @@ describe('Blob viewer', () => {
});
});
it('loads source file when line number is in hash', done => {
it('loads source file when line number is in hash', (done) => {
window.location.hash = '#L1';
new BlobViewer();
......@@ -117,7 +117,7 @@ describe('Blob viewer', () => {
expect(copyButton.blur).not.toHaveBeenCalled();
});
it('enables after switching to simple view', done => {
it('enables after switching to simple view', (done) => {
document.querySelector('.js-blob-viewer-switch-btn[data-viewer="simple"]').click();
setImmediate(() => {
......@@ -127,7 +127,7 @@ describe('Blob viewer', () => {
});
});
it('updates tooltip after switching to simple view', done => {
it('updates tooltip after switching to simple view', (done) => {
document.querySelector('.js-blob-viewer-switch-btn[data-viewer="simple"]').click();
setImmediate(() => {
......@@ -171,7 +171,7 @@ describe('Blob viewer', () => {
${['simple', 'rich']}
`('when view switches to $views', ({ views }) => {
beforeEach(async () => {
views.forEach(view => blob.switchToViewer(view));
views.forEach((view) => blob.switchToViewer(view));
await axios.waitForAll();
});
......
......@@ -31,7 +31,7 @@ describe('Blob Editing', () => {
FileTemplateExtension.mockClear();
});
const editorInst = isMarkdown => {
const editorInst = (isMarkdown) => {
return new EditBlob({
isMarkdown,
});
......
......@@ -82,7 +82,7 @@ const createComponent = ({
describe('Board list component', () => {
let wrapper;
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`);
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
useFakeRequestAnimationFrame();
afterEach(() => {
......
......@@ -72,7 +72,7 @@ describe('Board list component', () => {
}
describe('When Expanded', () => {
beforeEach(done => {
beforeEach((done) => {
getIssues = jest.spyOn(List.prototype, 'getIssues').mockReturnValue(new Promise(() => {}));
({ mock, component } = createComponent({ done }));
});
......@@ -204,7 +204,7 @@ describe('Board list component', () => {
});
describe('When Collapsed', () => {
beforeEach(done => {
beforeEach((done) => {
getIssues = jest.spyOn(List.prototype, 'getIssues').mockReturnValue(new Promise(() => {}));
({ mock, component } = createComponent({
done,
......@@ -228,7 +228,7 @@ describe('Board list component', () => {
});
describe('max issue count warning', () => {
beforeEach(done => {
beforeEach((done) => {
({ mock, component } = createComponent({
done,
listProps: { type: 'closed', collapsed: true, issuesSize: 50 },
......
......@@ -77,7 +77,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPost(endpoints.listsEndpoint).replyOnce(config => requestSpy(config));
axiosMock.onPost(endpoints.listsEndpoint).replyOnce((config) => requestSpy(config));
});
it('makes a request to create a list', () => {
......@@ -114,7 +114,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPut(`${endpoints.listsEndpoint}/${id}`).replyOnce(config => requestSpy(config));
axiosMock.onPut(`${endpoints.listsEndpoint}/${id}`).replyOnce((config) => requestSpy(config));
});
it('makes a request to update a list position', () => {
......@@ -148,7 +148,7 @@ describe('boardsStore', () => {
requestSpy = jest.fn();
axiosMock
.onDelete(`${endpoints.listsEndpoint}/${id}`)
.replyOnce(config => requestSpy(config));
.replyOnce((config) => requestSpy(config));
});
it('makes a request to delete a list', () => {
......@@ -269,7 +269,7 @@ describe('boardsStore', () => {
requestSpy = jest.fn();
axiosMock
.onPut(`${urlRoot}/-/boards/${boardId}/issues/${id}`)
.replyOnce(config => requestSpy(config));
.replyOnce((config) => requestSpy(config));
});
it('makes a request to move an issue between lists', () => {
......@@ -308,7 +308,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPost(url).replyOnce(config => requestSpy(config));
axiosMock.onPost(url).replyOnce((config) => requestSpy(config));
});
it('makes a request to create a new issue', () => {
......@@ -378,7 +378,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPost(endpoints.bulkUpdatePath).replyOnce(config => requestSpy(config));
axiosMock.onPost(endpoints.bulkUpdatePath).replyOnce((config) => requestSpy(config));
});
it('makes a request to create a list', () => {
......
......@@ -93,8 +93,8 @@ describe('BoardCardAssigneeDropdown', () => {
await wrapper.vm.$nextTick();
};
const findByText = text => {
return wrapper.findAll(GlDropdownItem).wrappers.find(node => node.text().indexOf(text) === 0);
const findByText = (text) => {
return wrapper.findAll(GlDropdownItem).wrappers.find((node) => node.text().indexOf(text) === 0);
};
const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
......
......@@ -22,7 +22,7 @@ describe('Board card layout', () => {
let list;
// this particular mount component needs to be used after the root beforeEach because it depends on list being initialized
const mountComponent = propsData => {
const mountComponent = (propsData) => {
wrapper = shallowMount(BoardCardLayout, {
stubs: {
issueCardInner,
......
......@@ -29,7 +29,7 @@ describe('BoardCard', () => {
const findUserAvatarLink = () => wrapper.find(userAvatarLink);
// this particular mount component needs to be used after the root beforeEach because it depends on list being initialized
const mountComponent = propsData => {
const mountComponent = (propsData) => {
wrapper = mount(BoardCard, {
stubs: {
issueCardInner,
......
......@@ -80,13 +80,13 @@ describe('Board List Header Component', () => {
const hasNoAddButton = [ListType.closed];
const hasAddButton = [ListType.backlog, ListType.label, ListType.milestone, ListType.assignee];
it.each(hasNoAddButton)('does not render when List Type is `%s`', listType => {
it.each(hasNoAddButton)('does not render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(false);
});
it.each(hasAddButton)('does render when List Type is `%s`', listType => {
it.each(hasAddButton)('does render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(true);
......@@ -95,7 +95,7 @@ describe('Board List Header Component', () => {
it('has a test for each list type', () => {
createComponent();
Object.values(ListType).forEach(value => {
Object.values(ListType).forEach((value) => {
expect([...hasAddButton, ...hasNoAddButton]).toContain(value);
});
});
......@@ -171,14 +171,14 @@ describe('Board List Header Component', () => {
it.each(cannotDragList)(
'does not have user-can-drag-class so user cannot drag list',
listType => {
(listType) => {
createComponent({ listType });
expect(findTitle().classes()).not.toContain('user-can-drag');
},
);
it.each(canDragList)('has user-can-drag-class so user can drag list', listType => {
it.each(canDragList)('has user-can-drag-class so user can drag list', (listType) => {
createComponent({ listType });
expect(findTitle().classes()).toContain('user-can-drag');
......
......@@ -76,20 +76,20 @@ describe('Board List Header Component', () => {
const hasNoAddButton = [ListType.closed];
const hasAddButton = [ListType.backlog, ListType.label, ListType.milestone, ListType.assignee];
it.each(hasNoAddButton)('does not render when List Type is `%s`', listType => {
it.each(hasNoAddButton)('does not render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(false);
});
it.each(hasAddButton)('does render when List Type is `%s`', listType => {
it.each(hasAddButton)('does render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(true);
});
it('has a test for each list type', () => {
Object.values(ListType).forEach(value => {
Object.values(ListType).forEach((value) => {
expect([...hasAddButton, ...hasNoAddButton]).toContain(value);
});
});
......
......@@ -26,7 +26,7 @@ describe('BoardsSelector', () => {
const boards = boardGenerator(20);
const recentBoards = boardGenerator(5);
const fillSearchBox = filterTerm => {
const fillSearchBox = (filterTerm) => {
const searchBox = wrapper.find({ ref: 'searchBox' });
const searchBoxInput = searchBox.find('input');
searchBoxInput.setValue(filterTerm);
......@@ -59,7 +59,7 @@ describe('BoardsSelector', () => {
data: {
group: {
boards: {
edges: boards.map(board => ({ node: board })),
edges: boards.map((board) => ({ node: board })),
},
},
},
......@@ -152,7 +152,7 @@ describe('BoardsSelector', () => {
it('shows only matching boards when filtering', () => {
const filterTerm = 'board1';
const expectedCount = boards.filter(board => board.name.includes(filterTerm)).length;
const expectedCount = boards.filter((board) => board.name.includes(filterTerm)).length;
fillSearchBox(filterTerm);
......
......@@ -6,7 +6,7 @@ describe('IssueCount', () => {
let maxIssueCount;
let issuesSize;
const createComponent = props => {
const createComponent = (props) => {
vm = shallowMount(IssueCount, { propsData: props });
};
......
......@@ -10,7 +10,7 @@ const createComponent = (dueDate = new Date(), closed = false) =>
},
});
const findTime = wrapper => wrapper.find('time');
const findTime = (wrapper) => wrapper.find('time');
describe('Issue Due Date component', () => {
let wrapper;
......
......@@ -31,7 +31,7 @@ describe('Issue Time Estimate component', () => {
expect(wrapper.find('.js-issue-time-estimate').text()).toContain('2 weeks 3 days 1 minute');
});
it('prevents tooltip xss', done => {
it('prevents tooltip xss', (done) => {
const alertSpy = jest.spyOn(window, 'alert');
wrapper.setProps({ estimate: 'Foo <script>alert("XSS")</script>' });
wrapper.vm.$nextTick(() => {
......
......@@ -28,7 +28,7 @@ describe('Issue Time Estimate component', () => {
expect(wrapper.find('.js-issue-time-estimate').text()).toContain('2 weeks 3 days 1 minute');
});
it('prevents tooltip xss', done => {
it('prevents tooltip xss', (done) => {
const alertSpy = jest.spyOn(window, 'alert');
wrapper.setProps({ estimate: 'Foo <script>alert("XSS")</script>' });
wrapper.vm.$nextTick(() => {
......
......@@ -83,7 +83,7 @@ describe('~/boards/components/sidebar/board_sidebar_subscription_spec.vue', () =
});
describe('Board sidebar subscription component `behavior`', () => {
const mockSetActiveIssueSubscribed = subscribedState => {
const mockSetActiveIssueSubscribed = (subscribedState) => {
jest.spyOn(wrapper.vm, 'setActiveIssueSubscribed').mockImplementation(async () => {
store.commit(types.UPDATE_ISSUE_BY_ID, {
issueId: mockActiveIssue.id,
......
......@@ -8,7 +8,7 @@ describe('boards sidebar remove issue', () => {
const findButton = () => wrapper.find(GlButton);
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(RemoveIssue, {
propsData: {
issue: {},
......
......@@ -79,7 +79,7 @@ describe('Issue card component', () => {
expect(wrapper.find('.issue-blocked-icon').exists()).toBe(false);
});
it('renders confidential icon', done => {
it('renders confidential icon', (done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......@@ -102,7 +102,7 @@ describe('Issue card component', () => {
});
describe('exists', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......@@ -132,7 +132,7 @@ describe('Issue card component', () => {
expect(wrapper.find('.board-card-assignee img').exists()).toBe(true);
});
it('renders the avatar using avatar_url property', done => {
it('renders the avatar using avatar_url property', (done) => {
wrapper.props('issue').updateData({
...wrapper.props('issue'),
assignees: [
......@@ -156,7 +156,7 @@ describe('Issue card component', () => {
});
describe('assignee default avatar', () => {
beforeEach(done => {
beforeEach((done) => {
global.gon.default_avatar_url = 'default_avatar';
wrapper.setProps({
......@@ -189,7 +189,7 @@ describe('Issue card component', () => {
});
describe('multiple assignees', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......@@ -224,7 +224,7 @@ describe('Issue card component', () => {
});
describe('more than three assignees', () => {
beforeEach(done => {
beforeEach((done) => {
const { assignees } = wrapper.props('issue');
assignees.push(
new ListAssignee({
......@@ -252,11 +252,11 @@ describe('Issue card component', () => {
expect(wrapper.findAll('.board-card-assignee .avatar').length).toEqual(2);
});
it('renders 99+ avatar counter', done => {
it('renders 99+ avatar counter', (done) => {
const assignees = [
...wrapper.props('issue').assignees,
...range(5, 103).map(
i =>
(i) =>
new ListAssignee({
id: i,
name: 'name',
......@@ -281,7 +281,7 @@ describe('Issue card component', () => {
});
describe('labels', () => {
beforeEach(done => {
beforeEach((done) => {
issue.addLabel(label1);
wrapper.setProps({ issue: { ...issue } });
......@@ -296,7 +296,7 @@ describe('Issue card component', () => {
expect(label.props('backgroundColor')).toEqual(label1.color);
});
it('does not render label if label does not have an ID', done => {
it('does not render label if label does not have an ID', (done) => {
issue.addLabel(
new ListLabel({
title: 'closed',
......@@ -315,7 +315,7 @@ describe('Issue card component', () => {
});
describe('blocked', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......
......@@ -260,7 +260,7 @@ describe('Issue card component', () => {
it('renders 99+ avatar counter', async () => {
const assignees = [
...wrapper.props('issue').assignees,
...range(5, 103).map(i => ({
...range(5, 103).map((i) => ({
id: i,
name: 'name',
username: 'username',
......
......@@ -37,7 +37,7 @@ describe('List model', () => {
describe('list type', () => {
const notExpandableList = ['blank'];
const table = Object.keys(ListType).map(k => {
const table = Object.keys(ListType).map((k) => {
const value = ListType[k];
return [value, !notExpandableList.includes(value)];
});
......@@ -186,7 +186,7 @@ describe('List model', () => {
list.issues = [];
});
it('adds new issue to top of list', done => {
it('adds new issue to top of list', (done) => {
const user = new ListAssignee({
id: 1,
name: 'testing 123',
......
......@@ -263,7 +263,7 @@ export const BoardsMockData = {
},
};
export const boardsMockInterceptor = config => {
export const boardsMockInterceptor = (config) => {
const body = BoardsMockData[config.method.toUpperCase()][config.url];
return [200, body];
};
......@@ -318,7 +318,7 @@ export const mockLists = [mockList, mockLabelList];
export const mockListsById = keyBy(mockLists, 'id');
export const mockListsWithModel = mockLists.map(listMock =>
export const mockListsWithModel = mockLists.map((listMock) =>
Vue.observable(new List({ ...listMock, doNotFetchIssues: true })),
);
......
......@@ -21,7 +21,7 @@ import createFlash from '~/flash';
jest.mock('~/flash');
const expectNotImplemented = action => {
const expectNotImplemented = (action) => {
it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!'));
});
......@@ -29,7 +29,7 @@ const expectNotImplemented = action => {
// We need this helper to make sure projectPath is including
// subgroups when the movIssue action is called.
const getProjectPath = path => path.split('#')[0];
const getProjectPath = (path) => path.split('#')[0];
beforeEach(() => {
window.gon = { features: {} };
......@@ -53,7 +53,7 @@ describe('setInitialBoardData', () => {
});
describe('setFilters', () => {
it('should commit mutation SET_FILTERS', done => {
it('should commit mutation SET_FILTERS', (done) => {
const state = {
filters: {},
};
......@@ -72,11 +72,11 @@ describe('setFilters', () => {
});
describe('performSearch', () => {
it('should dispatch setFilters action', done => {
it('should dispatch setFilters action', (done) => {
testAction(actions.performSearch, {}, {}, [], [{ type: 'setFilters', payload: {} }], done);
});
it('should dispatch setFilters, fetchLists and resetIssues action when graphqlBoardLists FF is on', done => {
it('should dispatch setFilters, fetchLists and resetIssues action when graphqlBoardLists FF is on', (done) => {
window.gon = { features: { graphqlBoardLists: true } };
testAction(
actions.performSearch,
......@@ -90,7 +90,7 @@ describe('performSearch', () => {
});
describe('setActiveId', () => {
it('should commit mutation SET_ACTIVE_ID', done => {
it('should commit mutation SET_ACTIVE_ID', (done) => {
const state = {
activeId: inactiveId,
};
......@@ -129,7 +129,7 @@ describe('fetchLists', () => {
const formattedLists = formatBoardLists(queryResponse.data.group.board.lists);
it('should commit mutations RECEIVE_BOARD_LISTS_SUCCESS on success', done => {
it('should commit mutations RECEIVE_BOARD_LISTS_SUCCESS on success', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction(
......@@ -147,7 +147,7 @@ describe('fetchLists', () => {
);
});
it('dispatch createList action when backlog list does not exist and is not hidden', done => {
it('dispatch createList action when backlog list does not exist and is not hidden', (done) => {
queryResponse = {
data: {
group: {
......@@ -179,7 +179,7 @@ describe('fetchLists', () => {
});
describe('createList', () => {
it('should dispatch addList action when creating backlog list', done => {
it('should dispatch addList action when creating backlog list', (done) => {
const backlogList = {
id: 'gid://gitlab/List/1',
listType: 'backlog',
......@@ -216,7 +216,7 @@ describe('createList', () => {
);
});
it('should commit CREATE_LIST_FAILURE mutation when API returns an error', done => {
it('should commit CREATE_LIST_FAILURE mutation when API returns an error', (done) => {
jest.spyOn(gqlClient, 'mutate').mockReturnValue(
Promise.resolve({
data: {
......@@ -248,7 +248,7 @@ describe('createList', () => {
});
describe('moveList', () => {
it('should commit MOVE_LIST mutation and dispatch updateList action', done => {
it('should commit MOVE_LIST mutation and dispatch updateList action', (done) => {
const initialBoardListsState = {
'gid://gitlab/List/1': mockLists[0],
'gid://gitlab/List/2': mockLists[1],
......@@ -321,7 +321,7 @@ describe('moveList', () => {
});
describe('updateList', () => {
it('should commit UPDATE_LIST_FAILURE mutation when API returns an error', done => {
it('should commit UPDATE_LIST_FAILURE mutation when API returns an error', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
updateBoardList: {
......@@ -438,7 +438,7 @@ describe('fetchIssuesForList', () => {
boardType: 'group',
};
const mockIssuesNodes = mockIssues.map(issue => ({ node: issue }));
const mockIssuesNodes = mockIssues.map((issue) => ({ node: issue }));
const pageInfo = {
endCursor: '',
......@@ -471,7 +471,7 @@ describe('fetchIssuesForList', () => {
[listId]: pageInfo,
};
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', done => {
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction(
......@@ -493,7 +493,7 @@ describe('fetchIssuesForList', () => {
);
});
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', done => {
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject());
testAction(
......@@ -540,7 +540,7 @@ describe('moveIssue', () => {
issues,
};
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', done => {
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueMoveList: {
......@@ -615,7 +615,7 @@ describe('moveIssue', () => {
expect(gqlClient.mutate).toHaveBeenCalledWith(mutationVariables);
});
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', done => {
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueMoveList: {
......@@ -686,7 +686,7 @@ describe('setAssignees', () => {
});
});
it('calls the correct mutation with the correct values', done => {
it('calls the correct mutation with the correct values', (done) => {
testAction(
actions.setAssignees,
{},
......@@ -743,7 +743,7 @@ describe('createNewIssue', () => {
expect(result).toEqual(mockIssue);
});
it('should commit CREATE_ISSUE_FAILURE mutation when API returns an error', done => {
it('should commit CREATE_ISSUE_FAILURE mutation when API returns an error', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
createIssue: {
......@@ -767,7 +767,7 @@ describe('createNewIssue', () => {
});
describe('addListIssue', () => {
it('should commit ADD_ISSUE_TO_LIST mutation', done => {
it('should commit ADD_ISSUE_TO_LIST mutation', (done) => {
const payload = {
list: mockLists[0],
issue: mockIssue,
......@@ -788,14 +788,14 @@ describe('addListIssue', () => {
describe('setActiveIssueLabels', () => {
const state = { issues: { [mockIssue.id]: mockIssue } };
const getters = { activeIssue: mockIssue };
const testLabelIds = labels.map(label => label.id);
const testLabelIds = labels.map((label) => label.id);
const input = {
addLabelIds: testLabelIds,
removeLabelIds: [],
projectPath: 'h/b',
};
it('should assign labels on success', done => {
it('should assign labels on success', (done) => {
jest
.spyOn(gqlClient, 'mutate')
.mockResolvedValue({ data: { updateIssue: { issue: { labels: { nodes: labels } } } } });
......@@ -839,7 +839,7 @@ describe('setActiveIssueDueDate', () => {
projectPath: 'h/b',
};
it('should commit due date after setting the issue', done => {
it('should commit due date after setting the issue', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
updateIssue: {
......@@ -890,7 +890,7 @@ describe('setActiveIssueSubscribed', () => {
projectPath: 'gitlab-org/gitlab-test',
};
it('should commit subscribed status', done => {
it('should commit subscribed status', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueSetSubscription: {
......@@ -944,7 +944,7 @@ describe('setActiveIssueMilestone', () => {
projectPath: 'h/b',
};
it('should commit milestone after setting the issue', done => {
it('should commit milestone after setting the issue', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
updateIssue: {
......
......@@ -84,7 +84,7 @@ describe('Boards - Getters', () => {
issues,
};
it('returns issues for a given listId', () => {
const getIssueById = issueId => [mockIssue, mockIssue2].find(({ id }) => id === issueId);
const getIssueById = (issueId) => [mockIssue, mockIssue2].find(({ id }) => id === issueId);
expect(getters.getIssuesByList(boardsState, { getIssueById })('gid://gitlab/List/2')).toEqual(
mockIssues,
......
......@@ -3,7 +3,7 @@ import * as types from '~/boards/stores/mutation_types';
import defaultState from '~/boards/stores/state';
import { mockLists, rawIssue, mockIssue, mockIssue2 } from '../mock_data';
const expectNotImplemented = action => {
const expectNotImplemented = (action) => {
it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!'));
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment