Commit 52907ac2 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 32 files - 65 of 73

Part of our prettier migration; changing the arrow-parens style.
parent d4a8b730
export const resetStore = store => {
export const resetStore = (store) => {
store.replaceState({
notes: [],
targetNoteHash: null,
......
......@@ -34,7 +34,7 @@ describe('Discussion navigation mixin', () => {
setHTMLFixture(
[...'abcde']
.map(
id =>
(id) =>
`<ul class="notes" data-discussion-id="${id}"></ul>
<div class="discussion" data-discussion-id="${id}"></div>`,
)
......
......@@ -127,7 +127,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
jest.spyOn(notes, 'renderNote');
$('.js-comment-button').on('click', e => {
$('.js-comment-button').on('click', (e) => {
const $form = $(this);
e.preventDefault();
notes.addNote($form, {});
......@@ -550,7 +550,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
expect($notesContainer.find('.note.being-posted').length).toBeGreaterThan(0);
});
it('should remove placeholder note when new comment is done posting', done => {
it('should remove placeholder note when new comment is done posting', (done) => {
mockNotesPost();
$('.js-comment-button').click();
......@@ -562,7 +562,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
});
describe('postComment', () => {
it('disables the submit button', done => {
it('disables the submit button', (done) => {
const $submitButton = $form.find('.js-comment-submit-button');
expect($submitButton).not.toBeDisabled();
......@@ -585,7 +585,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
});
});
it('should show actual note element when new comment is done posting', done => {
it('should show actual note element when new comment is done posting', (done) => {
mockNotesPost();
$('.js-comment-button').click();
......@@ -596,7 +596,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
});
});
it('should reset Form when new comment is done posting', done => {
it('should reset Form when new comment is done posting', (done) => {
mockNotesPost();
$('.js-comment-button').click();
......@@ -607,7 +607,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
});
});
it('should show flash error message when new comment failed to be posted', done => {
it('should show flash error message when new comment failed to be posted', (done) => {
mockNotesPostError();
jest.spyOn(notes, 'addFlash');
......@@ -658,7 +658,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
$form.find('textarea.js-note-text').val(sampleComment);
});
it('should remove quick action placeholder when comment with quick actions is done posting', done => {
it('should remove quick action placeholder when comment with quick actions is done posting', (done) => {
jest.spyOn(gl.awardsHandler, 'addAwardToEmojiBar');
$('.js-comment-button').click();
......@@ -693,7 +693,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
$form.find('textarea.js-note-text').val(sampleComment);
});
it('should show message placeholder including lines starting with slash', done => {
it('should show message placeholder including lines starting with slash', (done) => {
$('.js-comment-button').click();
expect($notesContainer.find('.note.being-posted').length).toEqual(1); // Placeholder shown
......@@ -731,7 +731,7 @@ describe.skip('Old Notes (~/notes.js)', () => {
$form.find('textarea.js-note-text').html(sampleComment);
});
it('should not render a script tag', done => {
it('should not render a script tag', (done) => {
$('.js-comment-button').click();
setImmediate(() => {
......
This diff is collapsed.
......@@ -72,7 +72,7 @@ describe('Getters Notes Store', () => {
state.isTimelineEnabled = true;
expect(getters.discussions(state).length).toEqual(discussionMock.notes.length);
getters.discussions(state).forEach(discussion => {
getters.discussions(state).forEach((discussion) => {
expect(discussion.individual_note).toBe(true);
expect(discussion.id).toBe(discussion.notes[0].id);
expect(discussion.created_at).toBe(discussion.notes[0].created_at);
......
......@@ -357,7 +357,7 @@ describe('Notes Store mutations', () => {
mutations.SET_EXPAND_DISCUSSIONS(state, { discussionIds, expanded: true });
state.discussions.forEach(discussion => {
state.discussions.forEach((discussion) => {
expect(discussion.expanded).toEqual(true);
});
});
......@@ -371,7 +371,7 @@ describe('Notes Store mutations', () => {
mutations.SET_EXPAND_DISCUSSIONS(state, { discussionIds, expanded: false });
state.discussions.forEach(discussion => {
state.discussions.forEach((discussion) => {
expect(discussion.expanded).toEqual(false);
});
});
......@@ -698,7 +698,7 @@ describe('Notes Store mutations', () => {
});
describe('SET_APPLYING_BATCH_STATE', () => {
const buildDiscussions = suggestionsInfo => {
const buildDiscussions = (suggestionsInfo) => {
const suggestions = suggestionsInfo.map(({ suggestionId }) => ({ id: suggestionId }));
const notes = suggestionsInfo.map(({ noteId }, index) => ({
......@@ -738,7 +738,7 @@ describe('Notes Store mutations', () => {
const expectedSuggestions = [updatedSuggestion, suggestions[1]];
const actualSuggestions = state.discussions
.map(discussion => discussion.notes.map(n => n.suggestions))
.map((discussion) => discussion.notes.map((n) => n.suggestions))
.flat(2);
expect(actualSuggestions).toEqual(expectedSuggestions);
......
......@@ -2,7 +2,7 @@ import $ from 'jquery';
import OAuthRememberMe from '~/pages/sessions/new/oauth_remember_me';
describe('OAuthRememberMe', () => {
const findFormAction = selector => {
const findFormAction = (selector) => {
return $(`#oauth-container .oauth-login${selector}`).parent('form').attr('action');
};
......
......@@ -11,7 +11,7 @@ describe('Package Additional Metadata', () => {
packageEntity: { ...mavenPackage },
};
const mountComponent = props => {
const mountComponent = (props) => {
wrapper = shallowMount(component, {
propsData: { ...defaultProps, ...props },
stubs: {
......@@ -33,7 +33,7 @@ describe('Package Additional Metadata', () => {
const findConanRecipe = () => wrapper.find('[data-testid="conan-recipe"]');
const findMavenApp = () => wrapper.find('[data-testid="maven-app"]');
const findMavenGroup = () => wrapper.find('[data-testid="maven-group"]');
const findElementLink = container => container.find(GlLink);
const findElementLink = (container) => container.find(GlLink);
it('has the correct title', () => {
mountComponent();
......
......@@ -15,10 +15,10 @@ describe('Package History', () => {
packageEntity: { ...mavenPackage },
};
const createPipelines = amount =>
const createPipelines = (amount) =>
[...Array(amount)].map((x, index) => ({ ...mockPipelineInfo, id: index + 1 }));
const mountComponent = props => {
const mountComponent = (props) => {
wrapper = shallowMount(component, {
propsData: { ...defaultProps, ...props },
stubs: {
......@@ -35,9 +35,9 @@ describe('Package History', () => {
wrapper = null;
});
const findHistoryElement = testId => wrapper.find(`[data-testid="${testId}"]`);
const findElementLink = container => container.find(GlLink);
const findElementTimeAgo = container => container.find(TimeAgoTooltip);
const findHistoryElement = (testId) => wrapper.find(`[data-testid="${testId}"]`);
const findElementLink = (container) => container.find(GlLink);
const findElementTimeAgo = (container) => container.find(TimeAgoTooltip);
const findTitle = () => wrapper.find('[data-testid="title"]');
const findTimeline = () => wrapper.find('[data-testid="timeline"]');
......
......@@ -12,7 +12,7 @@ jest.mock('~/api.js');
describe('Actions Package details store', () => {
describe('fetchPackageVersions', () => {
it('should fetch the package versions', done => {
it('should fetch the package versions', (done) => {
Api.projectPackage = jest.fn().mockResolvedValue({ data: packageEntity });
testAction(
......@@ -35,7 +35,7 @@ describe('Actions Package details store', () => {
);
});
it("does not set the versions if they don't exist", done => {
it("does not set the versions if they don't exist", (done) => {
Api.projectPackage = jest.fn().mockResolvedValue({ data: { packageEntity, versions: null } });
testAction(
......@@ -57,7 +57,7 @@ describe('Actions Package details store', () => {
);
});
it('should create flash on API error', done => {
it('should create flash on API error', (done) => {
Api.projectPackage = jest.fn().mockRejectedValue();
testAction(
......@@ -82,7 +82,7 @@ describe('Actions Package details store', () => {
});
describe('deletePackage', () => {
it('should call Api.deleteProjectPackage', done => {
it('should call Api.deleteProjectPackage', (done) => {
Api.deleteProjectPackage = jest.fn().mockResolvedValue();
testAction(deletePackage, undefined, { packageEntity }, [], [], () => {
expect(Api.deleteProjectPackage).toHaveBeenCalledWith(
......@@ -92,7 +92,7 @@ describe('Actions Package details store', () => {
done();
});
});
it('should create flash on API error', done => {
it('should create flash on API error', (done) => {
Api.deleteProjectPackage = jest.fn().mockRejectedValue();
testAction(deletePackage, undefined, { packageEntity }, [], [], () => {
......
......@@ -16,7 +16,7 @@ describe('packages_sort', () => {
const findPackageListSorting = () => wrapper.find(GlSorting);
const findSortingItems = () => wrapper.findAll(GlSortingItem);
const createStore = isGroupPage => {
const createStore = (isGroupPage) => {
const state = {
config: {
isGroupPage,
......
......@@ -30,7 +30,7 @@ describe('Actions Package list store', () => {
sort: 'asc',
orderBy: 'version',
};
it('should fetch the project packages list when isGroupPage is false', done => {
it('should fetch the project packages list when isGroupPage is false', (done) => {
testAction(
actions.requestPackagesList,
undefined,
......@@ -50,7 +50,7 @@ describe('Actions Package list store', () => {
);
});
it('should fetch the group packages list when isGroupPage is true', done => {
it('should fetch the group packages list when isGroupPage is true', (done) => {
testAction(
actions.requestPackagesList,
undefined,
......@@ -70,7 +70,7 @@ describe('Actions Package list store', () => {
);
});
it('should fetch packages of a certain type when selectedType is present', done => {
it('should fetch packages of a certain type when selectedType is present', (done) => {
const packageType = 'maven';
testAction(
......@@ -102,7 +102,7 @@ describe('Actions Package list store', () => {
);
});
it('should create flash on API error', done => {
it('should create flash on API error', (done) => {
Api.projectPackages = jest.fn().mockRejectedValue();
testAction(
actions.requestPackagesList,
......@@ -122,7 +122,7 @@ describe('Actions Package list store', () => {
});
describe('receivePackagesListSuccess', () => {
it('should set received packages', done => {
it('should set received packages', (done) => {
const data = 'foo';
testAction(
......@@ -140,7 +140,7 @@ describe('Actions Package list store', () => {
});
describe('setInitialState', () => {
it('should commit setInitialState', done => {
it('should commit setInitialState', (done) => {
testAction(
actions.setInitialState,
'1',
......@@ -153,7 +153,7 @@ describe('Actions Package list store', () => {
});
describe('setLoading', () => {
it('should commit set main loading', done => {
it('should commit set main loading', (done) => {
testAction(
actions.setLoading,
true,
......@@ -171,7 +171,7 @@ describe('Actions Package list store', () => {
delete_api_path: 'foo',
},
};
it('should perform a delete operation on _links.delete_api_path', done => {
it('should perform a delete operation on _links.delete_api_path', (done) => {
mock.onDelete(payload._links.delete_api_path).replyOnce(200);
Api.projectPackages = jest.fn().mockResolvedValue({ data: 'foo' });
......@@ -188,7 +188,7 @@ describe('Actions Package list store', () => {
);
});
it('should stop the loading and call create flash on api error', done => {
it('should stop the loading and call create flash on api error', (done) => {
mock.onDelete(payload._links.delete_api_path).replyOnce(400);
testAction(
actions.requestDeletePackage,
......@@ -211,7 +211,7 @@ describe('Actions Package list store', () => {
${'_links'} | ${{}}
${'delete_api_path'} | ${{ _links: {} }}
`('should reject and createFlash when $property is missing', ({ actionPayload }, done) => {
testAction(actions.requestDeletePackage, actionPayload, null, [], []).catch(e => {
testAction(actions.requestDeletePackage, actionPayload, null, [], []).catch((e) => {
expect(e).toEqual(new Error(MISSING_DELETE_PATH_ERROR));
expect(createFlash).toHaveBeenCalledWith(DELETE_PACKAGE_ERROR_MESSAGE);
done();
......@@ -220,7 +220,7 @@ describe('Actions Package list store', () => {
});
describe('setSorting', () => {
it('should commit SET_SORTING', done => {
it('should commit SET_SORTING', (done) => {
testAction(
actions.setSorting,
'foo',
......@@ -233,7 +233,7 @@ describe('Actions Package list store', () => {
});
describe('setFilter', () => {
it('should commit SET_FILTER', done => {
it('should commit SET_FILTER', (done) => {
testAction(
actions.setFilter,
'foo',
......
......@@ -21,8 +21,8 @@ describe('PackagePath', () => {
const ELLIPSIS_CHEVRON = 'ellipsis-chevron';
const LEAF_LINK = 'leaf-link';
const findItem = name => wrapper.find(`[data-testid="${name}"]`);
const findTooltip = w => getBinding(w.element, 'gl-tooltip');
const findItem = (name) => wrapper.find(`[data-testid="${name}"]`);
const findTooltip = (w) => getBinding(w.element, 'gl-tooltip');
afterEach(() => {
wrapper.destroy();
......@@ -64,13 +64,13 @@ describe('PackagePath', () => {
}
if (shouldExist.length) {
it.each(shouldExist)(`should have %s`, element => {
it.each(shouldExist)(`should have %s`, (element) => {
expect(findItem(element).exists()).toBe(true);
});
}
if (shouldNotExist.length) {
it.each(shouldNotExist)(`should not have %s`, element => {
it.each(shouldNotExist)(`should not have %s`, (element) => {
expect(findItem(element).exists()).toBe(false);
});
}
......
......@@ -13,7 +13,7 @@ describe('Packages shared utils', () => {
expect(packageTypeToTrackCategory()).toMatchInlineSnapshot(`"UI::undefined"`);
});
it.each(Object.keys(PackageType))('returns a correct category string for %s', packageKey => {
it.each(Object.keys(PackageType))('returns a correct category string for %s', (packageKey) => {
const packageName = PackageType[packageKey];
expect(packageTypeToTrackCategory(packageName)).toBe(
`UI::${TrackingCategories[packageName]}`,
......
......@@ -89,7 +89,7 @@ describe('pager', () => {
Pager.init();
});
it('shows loader while loading next page', done => {
it('shows loader while loading next page', (done) => {
mockSuccess();
jest.spyOn(Pager.loading, 'show').mockImplementation(() => {});
......@@ -102,7 +102,7 @@ describe('pager', () => {
});
});
it('hides loader on success', done => {
it('hides loader on success', (done) => {
mockSuccess();
jest.spyOn(Pager.loading, 'hide').mockImplementation(() => {});
......@@ -115,7 +115,7 @@ describe('pager', () => {
});
});
it('hides loader on error', done => {
it('hides loader on error', (done) => {
mockError();
jest.spyOn(Pager.loading, 'hide').mockImplementation(() => {});
......@@ -128,7 +128,7 @@ describe('pager', () => {
});
});
it('sends request to url with offset and limit params', done => {
it('sends request to url with offset and limit params', (done) => {
Pager.offset = 100;
Pager.limit = 20;
Pager.getOld();
......@@ -149,7 +149,7 @@ describe('pager', () => {
});
});
it('disables if return count is less than limit', done => {
it('disables if return count is less than limit', (done) => {
Pager.offset = 0;
Pager.limit = 20;
......
......@@ -8,10 +8,10 @@ describe('Abuse Reports', () => {
let $messages;
const assertMaxLength = $message => {
const assertMaxLength = ($message) => {
expect($message.text().length).toEqual(MAX_MESSAGE_LENGTH);
};
const findMessage = searchText =>
const findMessage = (searchText) =>
$messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first();
preloadFixtures(FIXTURE);
......
......@@ -24,7 +24,7 @@ describe('AccountAndLimits', () => {
expect($userInternalRegex.readOnly).toBeTruthy();
});
it('is checked', done => {
it('is checked', (done) => {
if (!$userDefaultExternal.prop('checked')) $userDefaultExternal.click();
expect($userDefaultExternal.prop('checked')).toBeTruthy();
......
......@@ -26,9 +26,9 @@ describe('stop_jobs_modal.vue', () => {
});
describe('onSubmit', () => {
it('stops jobs and redirects to overview page', done => {
it('stops jobs and redirects to overview page', (done) => {
const responseURL = `${TEST_HOST}/stop_jobs_modal.vue/jobs`;
jest.spyOn(axios, 'post').mockImplementation(url => {
jest.spyOn(axios, 'post').mockImplementation((url) => {
expect(url).toBe(props.url);
return Promise.resolve({
request: {
......@@ -45,16 +45,16 @@ describe('stop_jobs_modal.vue', () => {
.catch(done.fail);
});
it('displays error if stopping jobs failed', done => {
it('displays error if stopping jobs failed', (done) => {
const dummyError = new Error('stopping jobs failed');
jest.spyOn(axios, 'post').mockImplementation(url => {
jest.spyOn(axios, 'post').mockImplementation((url) => {
expect(url).toBe(props.url);
return Promise.reject(dummyError);
});
vm.onSubmit()
.then(done.fail)
.catch(error => {
.catch((error) => {
expect(error).toBe(dummyError);
expect(redirectTo).not.toHaveBeenCalled();
})
......
......@@ -11,10 +11,10 @@ describe('User Operation confirmation modal', () => {
let wrapper;
let formSubmitSpy;
const findButton = variant =>
const findButton = (variant) =>
wrapper
.findAll(GlButton)
.filter(w => w.attributes('variant') === variant)
.filter((w) => w.attributes('variant') === variant)
.at(0);
const findForm = () => wrapper.find('form');
const findUsernameInput = () => wrapper.find(GlFormInput);
......@@ -25,7 +25,7 @@ describe('User Operation confirmation modal', () => {
const getMethodParam = () => new FormData(findForm().element).get('_method');
const getFormAction = () => findForm().attributes('action');
const setUsername = username => {
const setUsername = (username) => {
findUsernameInput().vm.$emit('input', username);
};
......
......@@ -20,7 +20,7 @@ describe('UserInternalRegexHandler', () => {
});
describe('Behaviour of userExternal checkbox when', () => {
it('matches email as internal', done => {
it('matches email as internal', (done) => {
expect($warningMessage.hasClass('hidden')).toBeTruthy();
$userEmail.val('test@').trigger('input');
......@@ -30,7 +30,7 @@ describe('UserInternalRegexHandler', () => {
done();
});
it('matches email as external', done => {
it('matches email as external', (done) => {
expect($warningMessage.hasClass('hidden')).toBeTruthy();
$userEmail.val('test.ext@').trigger('input');
......
......@@ -31,10 +31,10 @@ describe('Todos', () => {
});
describe('goToTodoUrl', () => {
it('opens the todo url', done => {
it('opens the todo url', (done) => {
const todoLink = todoItem.dataset.url;
visitUrl.mockImplementation(url => {
visitUrl.mockImplementation((url) => {
expect(url).toEqual(todoLink);
done();
});
......@@ -61,7 +61,7 @@ describe('Todos', () => {
});
it('run native funcionality when avatar is clicked', () => {
$('.todos-list a').on('click', e => e.preventDefault());
$('.todos-list a').on('click', (e) => e.preventDefault());
$('.todos-list img').trigger(metakeyEvent);
expect(visitUrl).not.toHaveBeenCalled();
......@@ -72,7 +72,7 @@ describe('Todos', () => {
describe('on done todo click', () => {
let onToggleSpy;
beforeEach(done => {
beforeEach((done) => {
const el = document.querySelector('.js-done-todo');
const path = el.dataset.href;
......
......@@ -15,7 +15,7 @@ describe('BitbucketServerStatusTable', () => {
const findReconfigureButton = () =>
wrapper
.findAll(GlButton)
.filter(w => w.props().variant === 'info')
.filter((w) => w.props().variant === 'info')
.at(0);
afterEach(() => {
......
......@@ -50,9 +50,9 @@ describe('Promote label modal', () => {
vm.$destroy();
});
it('redirects when a label is promoted', done => {
it('redirects when a label is promoted', (done) => {
const responseURL = `${TEST_HOST}/dummy/endpoint`;
jest.spyOn(axios, 'post').mockImplementation(url => {
jest.spyOn(axios, 'post').mockImplementation((url) => {
expect(url).toBe(labelMockData.url);
expect(eventHub.$emit).toHaveBeenCalledWith(
'promoteLabelModal.requestStarted',
......@@ -76,10 +76,10 @@ describe('Promote label modal', () => {
.catch(done.fail);
});
it('displays an error if promoting a label failed', done => {
it('displays an error if promoting a label failed', (done) => {
const dummyError = new Error('promoting label failed');
dummyError.response = { status: 500 };
jest.spyOn(axios, 'post').mockImplementation(url => {
jest.spyOn(axios, 'post').mockImplementation((url) => {
expect(url).toBe(labelMockData.url);
expect(eventHub.$emit).toHaveBeenCalledWith(
'promoteLabelModal.requestStarted',
......@@ -89,7 +89,7 @@ describe('Promote label modal', () => {
});
vm.onSubmit()
.catch(error => {
.catch((error) => {
expect(error).toBe(dummyError);
expect(eventHub.$emit).toHaveBeenCalledWith('promoteLabelModal.requestFinished', {
labelUrl: labelMockData.url,
......
......@@ -32,9 +32,9 @@ describe('delete_milestone_modal.vue', () => {
jest.spyOn(eventHub, '$emit').mockImplementation(() => {});
});
it('deletes milestone and redirects to overview page', done => {
it('deletes milestone and redirects to overview page', (done) => {
const responseURL = `${TEST_HOST}/delete_milestone_modal.vue/milestoneOverview`;
jest.spyOn(axios, 'delete').mockImplementation(url => {
jest.spyOn(axios, 'delete').mockImplementation((url) => {
expect(url).toBe(props.milestoneUrl);
expect(eventHub.$emit).toHaveBeenCalledWith(
'deleteMilestoneModal.requestStarted',
......@@ -60,10 +60,10 @@ describe('delete_milestone_modal.vue', () => {
.catch(done.fail);
});
it('displays error if deleting milestone failed', done => {
it('displays error if deleting milestone failed', (done) => {
const dummyError = new Error('deleting milestone failed');
dummyError.response = { status: 418 };
jest.spyOn(axios, 'delete').mockImplementation(url => {
jest.spyOn(axios, 'delete').mockImplementation((url) => {
expect(url).toBe(props.milestoneUrl);
expect(eventHub.$emit).toHaveBeenCalledWith(
'deleteMilestoneModal.requestStarted',
......@@ -74,7 +74,7 @@ describe('delete_milestone_modal.vue', () => {
});
vm.onSubmit()
.catch(error => {
.catch((error) => {
expect(error).toBe(dummyError);
expect(redirectTo).not.toHaveBeenCalled();
expect(eventHub.$emit).toHaveBeenCalledWith('deleteMilestoneModal.requestFinished', {
......
......@@ -46,9 +46,9 @@ describe('Promote milestone modal', () => {
vm.$destroy();
});
it('redirects when a milestone is promoted', done => {
it('redirects when a milestone is promoted', (done) => {
const responseURL = `${TEST_HOST}/dummy/endpoint`;
jest.spyOn(axios, 'post').mockImplementation(url => {
jest.spyOn(axios, 'post').mockImplementation((url) => {
expect(url).toBe(milestoneMockData.url);
expect(eventHub.$emit).toHaveBeenCalledWith(
'promoteMilestoneModal.requestStarted',
......@@ -72,10 +72,10 @@ describe('Promote milestone modal', () => {
.catch(done.fail);
});
it('displays an error if promoting a milestone failed', done => {
it('displays an error if promoting a milestone failed', (done) => {
const dummyError = new Error('promoting milestone failed');
dummyError.response = { status: 500 };
jest.spyOn(axios, 'post').mockImplementation(url => {
jest.spyOn(axios, 'post').mockImplementation((url) => {
expect(url).toBe(milestoneMockData.url);
expect(eventHub.$emit).toHaveBeenCalledWith(
'promoteMilestoneModal.requestStarted',
......@@ -85,7 +85,7 @@ describe('Promote milestone modal', () => {
});
vm.onSubmit()
.catch(error => {
.catch((error) => {
expect(error).toBe(dummyError);
expect(eventHub.$emit).toHaveBeenCalledWith('promoteMilestoneModal.requestFinished', {
milestoneUrl: milestoneMockData.url,
......
......@@ -46,7 +46,7 @@ describe('EmojiMenu', () => {
const dummyEmoji = 'tropical_fish';
const dummyVotesBlock = () => $('<div />');
it('calls selectEmojiCallback', done => {
it('calls selectEmojiCallback', (done) => {
expect(dummySelectEmojiCallback).not.toHaveBeenCalled();
emojiMenu.addAward(dummyVotesBlock(), dummyAwardUrl, dummyEmoji, false, () => {
......@@ -55,7 +55,7 @@ describe('EmojiMenu', () => {
});
});
it('does not make an axios request', done => {
it('does not make an axios request', (done) => {
jest.spyOn(axios, 'request').mockReturnValue();
emojiMenu.addAward(dummyVotesBlock(), dummyAwardUrl, dummyEmoji, false, () => {
......
......@@ -30,7 +30,7 @@ describe('Fork groups list item component', () => {
const DUMMY_PATH = '/dummy/path';
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = shallowMount(ForkGroupsListItem, {
propsData: {
...DEFAULT_PROPS,
......@@ -70,7 +70,7 @@ describe('Fork groups list item component', () => {
expect(
wrapper
.findAll(GlLink)
.filter(w => w.text() === DUMMY_FULL_NAME)
.filter((w) => w.text() === DUMMY_FULL_NAME)
.at(0)
.attributes().href,
).toBe(DUMMY_PATH);
......
......@@ -21,7 +21,7 @@ describe('Fork groups list component', () => {
const replyWith = (...args) => axiosMock.onGet(DEFAULT_PROPS.endpoint).reply(...args);
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = shallowMount(ForkGroupsList, {
propsData: {
...DEFAULT_PROPS,
......
......@@ -26,7 +26,7 @@ describe('Interval Pattern Input Component', () => {
const findCustomInput = () => wrapper.find('#schedule_cron');
const findAllLabels = () => wrapper.findAll('label');
const findSelectedRadio = () =>
wrapper.findAll('input[type="radio"]').wrappers.find(x => x.element.checked);
wrapper.findAll('input[type="radio"]').wrappers.find((x) => x.element.checked);
const findSelectedRadioKey = () => findSelectedRadio()?.attributes('data-testid');
const selectEveryDayRadio = () => findEveryDayRadio().trigger('click');
const selectEveryWeekRadio = () => findEveryWeekRadio().trigger('click');
......@@ -129,7 +129,7 @@ describe('Interval Pattern Input Component', () => {
});
it('renders each label for radio options properly', () => {
const labels = findAllLabels().wrappers.map(el => trimText(el.text()));
const labels = findAllLabels().wrappers.map((el) => trimText(el.text()));
expect(labels).toEqual([
'Every day (at 4:00am)',
......
......@@ -47,7 +47,7 @@ describe('Timezone Dropdown', () => {
const data = $dropdownEl.data('data');
const formatted = $wrapper.find(tzListSel).text();
data.forEach(item => {
data.forEach((item) => {
expect(formatted).toContain(formatTimezone(item));
});
});
......@@ -100,7 +100,7 @@ describe('Timezone Dropdown', () => {
new TimezoneDropdown({
$inputEl,
$dropdownEl,
displayFormat: selectedItem => formatTimezone(selectedItem),
displayFormat: (selectedItem) => formatTimezone(selectedItem),
});
expect($wrapper.find(tzDropdownToggleText).html()).toEqual('[UTC - 2.5] Newfoundland');
......
......@@ -19,7 +19,7 @@ describe('Project Feature Settings', () => {
};
let wrapper;
const mountComponent = customProps => {
const mountComponent = (customProps) => {
const propsData = { ...defaultProps, ...customProps };
return shallowMount(projectFeatureSetting, { propsData });
};
......
......@@ -367,7 +367,7 @@ describe('Settings Panel', () => {
const repositoryFeatureToggleButton = findRepositoryFeatureSetting().find('button');
const lfsFeatureToggleButton = findLFSFeatureToggle().find('button');
const isToggleButtonChecked = toggleButton => toggleButton.classes('is-checked');
const isToggleButtonChecked = (toggleButton) => toggleButton.classes('is-checked');
// assert the initial state
expect(isToggleButtonChecked(lfsFeatureToggleButton)).toBe(true);
......
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