Commit 157e117f authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 55 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 7cfe360c
...@@ -1706,39 +1706,6 @@ spec/frontend/behaviors/markdown/paste_markdown_table_spec.js ...@@ -1706,39 +1706,6 @@ spec/frontend/behaviors/markdown/paste_markdown_table_spec.js
spec/frontend/behaviors/quick_submit_spec.js spec/frontend/behaviors/quick_submit_spec.js
spec/frontend/behaviors/secret_values_spec.js spec/frontend/behaviors/secret_values_spec.js
## busy-mayer
spec/frontend/branches/branches_delete_modal_spec.js
spec/frontend/ci_settings_pipeline_triggers/components/triggers_list_spec.js
spec/frontend/ci_variable_list/components/ci_environments_dropdown_spec.js
spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js
spec/frontend/ci_variable_list/components/ci_variable_settings_spec.js
spec/frontend/ci_variable_list/store/actions_spec.js
spec/frontend/clusters/clusters_bundle_spec.js
spec/frontend/clusters/components/application_row_spec.js
spec/frontend/clusters/components/applications_spec.js
spec/frontend/clusters/components/fluentd_output_settings_spec.js
spec/frontend/clusters/services/application_state_machine_spec.js
spec/frontend/clusters_list/components/node_error_help_text_spec.js
spec/frontend/clusters_list/store/actions_spec.js
spec/frontend/code_navigation/store/actions_spec.js
spec/frontend/collapsed_sidebar_todo_spec.js
spec/frontend/commit/commit_pipeline_status_component_spec.js
spec/frontend/commit/pipelines/pipelines_spec.js
spec/frontend/commits_spec.js
spec/frontend/confirm_modal_spec.js
spec/frontend/contributors/store/actions_spec.js
spec/frontend/create_cluster/eks_cluster/components/eks_cluster_configuration_form_spec.js
spec/frontend/create_cluster/eks_cluster/store/actions_spec.js
spec/frontend/create_cluster/eks_cluster/store/getters_spec.js
spec/frontend/create_cluster/eks_cluster/store/mutations_spec.js
spec/frontend/create_cluster/gke_cluster/helpers.js
spec/frontend/create_cluster/gke_cluster/stores/actions_spec.js
spec/frontend/create_cluster/gke_cluster_namespace/gke_cluster_namespace_spec.js
spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js
spec/frontend/create_item_dropdown_spec.js
spec/frontend/create_merge_request_dropdown_spec.js
spec/frontend/custom_metrics/components/custom_metrics_form_fields_spec.js
## eloquent-black ## eloquent-black
spec/frontend/cycle_analytics/limit_warning_component_spec.js spec/frontend/cycle_analytics/limit_warning_component_spec.js
spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js
......
...@@ -15,7 +15,7 @@ describe('branches delete modal', () => { ...@@ -15,7 +15,7 @@ describe('branches delete modal', () => {
</div> </div>
`); `);
$deleteButton = $('.js-delete-branch'); $deleteButton = $('.js-delete-branch');
submitSpy = jest.fn(event => event.preventDefault()); submitSpy = jest.fn((event) => event.preventDefault());
$('#modal-delete-branch form').on('submit', submitSpy); $('#modal-delete-branch form').on('submit', submitSpy);
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new DeleteModal(); new DeleteModal();
......
...@@ -16,14 +16,14 @@ describe('TriggersList', () => { ...@@ -16,14 +16,14 @@ describe('TriggersList', () => {
}; };
const findTable = () => wrapper.find(GlTable); const findTable = () => wrapper.find(GlTable);
const findHeaderAt = i => wrapper.findAll('thead th').at(i); const findHeaderAt = (i) => wrapper.findAll('thead th').at(i);
const findRows = () => wrapper.findAll('tbody tr'); const findRows = () => wrapper.findAll('tbody tr');
const findRowAt = i => findRows().at(i); const findRowAt = (i) => findRows().at(i);
const findCell = (i, col) => findRowAt(i).findAll('td').at(col); const findCell = (i, col) => findRowAt(i).findAll('td').at(col);
const findClipboardBtn = i => findCell(i, 0).find(ClipboardButton); const findClipboardBtn = (i) => findCell(i, 0).find(ClipboardButton);
const findInvalidBadge = i => findCell(i, 0).find(GlBadge); const findInvalidBadge = (i) => findCell(i, 0).find(GlBadge);
const findEditBtn = i => findRowAt(i).find('[data-testid="edit-btn"]'); const findEditBtn = (i) => findRowAt(i).find('[data-testid="edit-btn"]');
const findRevokeBtn = i => findRowAt(i).find('[data-testid="trigger_revoke_button"]'); const findRevokeBtn = (i) => findRowAt(i).find('[data-testid="trigger_revoke_button"]');
beforeEach(() => { beforeEach(() => {
createComponent(); createComponent();
......
...@@ -10,7 +10,7 @@ describe('Ci environments dropdown', () => { ...@@ -10,7 +10,7 @@ describe('Ci environments dropdown', () => {
let wrapper; let wrapper;
let store; let store;
const createComponent = term => { const createComponent = (term) => {
store = new Vuex.Store({ store = new Vuex.Store({
getters: { getters: {
joinedEnvironments: () => ['dev', 'prod', 'staging'], joinedEnvironments: () => ['dev', 'prod', 'staging'],
...@@ -27,8 +27,8 @@ describe('Ci environments dropdown', () => { ...@@ -27,8 +27,8 @@ describe('Ci environments dropdown', () => {
}; };
const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem); const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem);
const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index); const findDropdownItemByIndex = (index) => wrapper.findAll(GlDropdownItem).at(index);
const findActiveIconByIndex = index => findDropdownItemByIndex(index).find(GlIcon); const findActiveIconByIndex = (index) => findDropdownItemByIndex(index).find(GlIcon);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -78,7 +78,7 @@ describe('Ci environments dropdown', () => { ...@@ -78,7 +78,7 @@ describe('Ci environments dropdown', () => {
}); });
it('should not display create button', () => { it('should not display create button', () => {
const environments = findAllDropdownItems().filter(env => env.text().startsWith('Create')); const environments = findAllDropdownItems().filter((env) => env.text().startsWith('Create'));
expect(environments).toHaveLength(0); expect(environments).toHaveLength(0);
expect(findAllDropdownItems()).toHaveLength(1); expect(findAllDropdownItems()).toHaveLength(1);
}); });
......
...@@ -31,11 +31,11 @@ describe('Ci variable modal', () => { ...@@ -31,11 +31,11 @@ describe('Ci variable modal', () => {
const findAddorUpdateButton = () => const findAddorUpdateButton = () =>
findModal() findModal()
.findAll(GlButton) .findAll(GlButton)
.wrappers.find(button => button.props('variant') === 'success'); .wrappers.find((button) => button.props('variant') === 'success');
const deleteVariableButton = () => const deleteVariableButton = () =>
findModal() findModal()
.findAll(GlButton) .findAll(GlButton)
.wrappers.find(button => button.props('variant') === 'danger'); .wrappers.find((button) => button.props('variant') === 'danger');
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
......
...@@ -11,7 +11,7 @@ describe('Ci variable table', () => { ...@@ -11,7 +11,7 @@ describe('Ci variable table', () => {
let store; let store;
let isGroup; let isGroup;
const createComponent = groupState => { const createComponent = (groupState) => {
store = createStore(); store = createStore();
store.state.isGroup = groupState; store.state.isGroup = groupState;
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
......
...@@ -86,7 +86,7 @@ describe('CI variable list store actions', () => { ...@@ -86,7 +86,7 @@ describe('CI variable list store actions', () => {
}); });
describe('deleteVariable', () => { describe('deleteVariable', () => {
it('dispatch correct actions on successful deleted variable', done => { it('dispatch correct actions on successful deleted variable', (done) => {
mock.onPatch(state.endpoint).reply(200); mock.onPatch(state.endpoint).reply(200);
testAction( testAction(
...@@ -105,7 +105,7 @@ describe('CI variable list store actions', () => { ...@@ -105,7 +105,7 @@ describe('CI variable list store actions', () => {
); );
}); });
it('should show flash error and set error in state on delete failure', done => { it('should show flash error and set error in state on delete failure', (done) => {
mock.onPatch(state.endpoint).reply(500, ''); mock.onPatch(state.endpoint).reply(500, '');
testAction( testAction(
...@@ -129,7 +129,7 @@ describe('CI variable list store actions', () => { ...@@ -129,7 +129,7 @@ describe('CI variable list store actions', () => {
}); });
describe('updateVariable', () => { describe('updateVariable', () => {
it('dispatch correct actions on successful updated variable', done => { it('dispatch correct actions on successful updated variable', (done) => {
mock.onPatch(state.endpoint).reply(200); mock.onPatch(state.endpoint).reply(200);
testAction( testAction(
...@@ -148,7 +148,7 @@ describe('CI variable list store actions', () => { ...@@ -148,7 +148,7 @@ describe('CI variable list store actions', () => {
); );
}); });
it('should show flash error and set error in state on update failure', done => { it('should show flash error and set error in state on update failure', (done) => {
mock.onPatch(state.endpoint).reply(500, ''); mock.onPatch(state.endpoint).reply(500, '');
testAction( testAction(
...@@ -172,7 +172,7 @@ describe('CI variable list store actions', () => { ...@@ -172,7 +172,7 @@ describe('CI variable list store actions', () => {
}); });
describe('addVariable', () => { describe('addVariable', () => {
it('dispatch correct actions on successful added variable', done => { it('dispatch correct actions on successful added variable', (done) => {
mock.onPatch(state.endpoint).reply(200); mock.onPatch(state.endpoint).reply(200);
testAction( testAction(
...@@ -191,7 +191,7 @@ describe('CI variable list store actions', () => { ...@@ -191,7 +191,7 @@ describe('CI variable list store actions', () => {
); );
}); });
it('should show flash error and set error in state on add failure', done => { it('should show flash error and set error in state on add failure', (done) => {
mock.onPatch(state.endpoint).reply(500, ''); mock.onPatch(state.endpoint).reply(500, '');
testAction( testAction(
...@@ -215,7 +215,7 @@ describe('CI variable list store actions', () => { ...@@ -215,7 +215,7 @@ describe('CI variable list store actions', () => {
}); });
describe('fetchVariables', () => { describe('fetchVariables', () => {
it('dispatch correct actions on fetchVariables', done => { it('dispatch correct actions on fetchVariables', (done) => {
mock.onGet(state.endpoint).reply(200, { variables: mockData.mockVariables }); mock.onGet(state.endpoint).reply(200, { variables: mockData.mockVariables });
testAction( testAction(
...@@ -236,7 +236,7 @@ describe('CI variable list store actions', () => { ...@@ -236,7 +236,7 @@ describe('CI variable list store actions', () => {
); );
}); });
it('should show flash error and set error in state on fetch variables failure', done => { it('should show flash error and set error in state on fetch variables failure', (done) => {
mock.onGet(state.endpoint).reply(500); mock.onGet(state.endpoint).reply(500);
testAction(actions.fetchVariables, {}, state, [], [{ type: 'requestVariables' }], () => { testAction(actions.fetchVariables, {}, state, [], [{ type: 'requestVariables' }], () => {
...@@ -247,7 +247,7 @@ describe('CI variable list store actions', () => { ...@@ -247,7 +247,7 @@ describe('CI variable list store actions', () => {
}); });
describe('fetchEnvironments', () => { describe('fetchEnvironments', () => {
it('dispatch correct actions on fetchEnvironments', done => { it('dispatch correct actions on fetchEnvironments', (done) => {
Api.environments = jest.fn().mockResolvedValue({ data: mockData.mockEnvironments }); Api.environments = jest.fn().mockResolvedValue({ data: mockData.mockEnvironments });
testAction( testAction(
...@@ -268,7 +268,7 @@ describe('CI variable list store actions', () => { ...@@ -268,7 +268,7 @@ describe('CI variable list store actions', () => {
); );
}); });
it('should show flash error and set error in state on fetch environments failure', done => { it('should show flash error and set error in state on fetch environments failure', (done) => {
Api.environments = jest.fn().mockRejectedValue(); Api.environments = jest.fn().mockRejectedValue();
testAction( testAction(
......
...@@ -279,7 +279,7 @@ describe('Clusters', () => { ...@@ -279,7 +279,7 @@ describe('Clusters', () => {
}); });
describe('uninstallApplication', () => { describe('uninstallApplication', () => {
it.each(APPLICATIONS)('tries to uninstall %s', applicationId => { it.each(APPLICATIONS)('tries to uninstall %s', (applicationId) => {
jest.spyOn(cluster.service, 'uninstallApplication').mockResolvedValueOnce(); jest.spyOn(cluster.service, 'uninstallApplication').mockResolvedValueOnce();
cluster.store.state.applications[applicationId].status = INSTALLED; cluster.store.state.applications[applicationId].status = INSTALLED;
......
...@@ -15,7 +15,7 @@ describe('Application Row', () => { ...@@ -15,7 +15,7 @@ describe('Application Row', () => {
wrapper.destroy(); wrapper.destroy();
}); });
const mountComponent = data => { const mountComponent = (data) => {
wrapper = shallowMount(ApplicationRow, { wrapper = shallowMount(ApplicationRow, {
stubs: { GlSprintf }, stubs: { GlSprintf },
propsData: { propsData: {
......
...@@ -29,8 +29,8 @@ describe('Applications', () => { ...@@ -29,8 +29,8 @@ describe('Applications', () => {
}); });
}; };
const createShallowApp = options => createApp(options, true); const createShallowApp = (options) => createApp(options, true);
const findByTestId = id => wrapper.find(`[data-testid="${id}"]`); const findByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
......
...@@ -37,11 +37,11 @@ describe('FluentdOutputSettings', () => { ...@@ -37,11 +37,11 @@ describe('FluentdOutputSettings', () => {
const findSaveButton = () => wrapper.find({ ref: 'saveBtn' }); const findSaveButton = () => wrapper.find({ ref: 'saveBtn' });
const findCancelButton = () => wrapper.find({ ref: 'cancelBtn' }); const findCancelButton = () => wrapper.find({ ref: 'cancelBtn' });
const findProtocolDropdown = () => wrapper.find(GlDropdown); const findProtocolDropdown = () => wrapper.find(GlDropdown);
const findCheckbox = name => const findCheckbox = (name) =>
wrapper.findAll(GlFormCheckbox).wrappers.find(x => x.text() === name); wrapper.findAll(GlFormCheckbox).wrappers.find((x) => x.text() === name);
const findHost = () => wrapper.find('#fluentd-host'); const findHost = () => wrapper.find('#fluentd-host');
const findPort = () => wrapper.find('#fluentd-port'); const findPort = () => wrapper.find('#fluentd-port');
const changeCheckbox = checkbox => { const changeCheckbox = (checkbox) => {
const currentValue = checkbox.attributes('checked')?.toString() === 'true'; const currentValue = checkbox.attributes('checked')?.toString() === 'true';
checkbox.vm.$emit('input', !currentValue); checkbox.vm.$emit('input', !currentValue);
}; };
...@@ -49,9 +49,9 @@ describe('FluentdOutputSettings', () => { ...@@ -49,9 +49,9 @@ describe('FluentdOutputSettings', () => {
element.value = val; element.value = val;
element.dispatchEvent(new Event('input')); element.dispatchEvent(new Event('input'));
}; };
const changePort = val => changeInput(findPort(), val); const changePort = (val) => changeInput(findPort(), val);
const changeHost = val => changeInput(findHost(), val); const changeHost = (val) => changeInput(findHost(), val);
const changeProtocol = idx => findProtocolDropdown().vm.$children[idx].$emit('click'); const changeProtocol = (idx) => findProtocolDropdown().vm.$children[idx].$emit('click');
const toApplicationSettings = ({ wafLogEnabled, ciliumLogEnabled, ...settings }) => ({ const toApplicationSettings = ({ wafLogEnabled, ciliumLogEnabled, ...settings }) => ({
...settings, ...settings,
waf_log_enabled: wafLogEnabled, waf_log_enabled: wafLogEnabled,
......
...@@ -25,7 +25,7 @@ const { ...@@ -25,7 +25,7 @@ const {
const NO_EFFECTS = 'no effects'; const NO_EFFECTS = 'no effects';
describe('applicationStateMachine', () => { describe('applicationStateMachine', () => {
const noEffectsToEmptyObject = effects => (typeof effects === 'string' ? {} : effects); const noEffectsToEmptyObject = (effects) => (typeof effects === 'string' ? {} : effects);
describe(`current state is ${NO_STATUS}`, () => { describe(`current state is ${NO_STATUS}`, () => {
it.each` it.each`
...@@ -42,7 +42,7 @@ describe('applicationStateMachine', () => { ...@@ -42,7 +42,7 @@ describe('applicationStateMachine', () => {
${UNINSTALLING} | ${UNINSTALLING} | ${NO_EFFECTS} ${UNINSTALLING} | ${UNINSTALLING} | ${NO_EFFECTS}
${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }} ${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }}
${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS} ${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: NO_STATUS, status: NO_STATUS,
...@@ -59,7 +59,7 @@ describe('applicationStateMachine', () => { ...@@ -59,7 +59,7 @@ describe('applicationStateMachine', () => {
it.each` it.each`
expectedState | event | effects expectedState | event | effects
${INSTALLABLE} | ${INSTALLABLE} | ${NO_EFFECTS} ${INSTALLABLE} | ${INSTALLABLE} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: NOT_INSTALLABLE, status: NOT_INSTALLABLE,
...@@ -79,7 +79,7 @@ describe('applicationStateMachine', () => { ...@@ -79,7 +79,7 @@ describe('applicationStateMachine', () => {
${INSTALLED} | ${INSTALLED} | ${{ installFailed: false }} ${INSTALLED} | ${INSTALLED} | ${{ installFailed: false }}
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS} ${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
${UNINSTALLED} | ${UNINSTALLED} | ${{ installFailed: false }} ${UNINSTALLED} | ${UNINSTALLED} | ${{ installFailed: false }}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: INSTALLABLE, status: INSTALLABLE,
...@@ -97,7 +97,7 @@ describe('applicationStateMachine', () => { ...@@ -97,7 +97,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects expectedState | event | effects
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS} ${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }} ${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: INSTALLING, status: INSTALLING,
...@@ -118,7 +118,7 @@ describe('applicationStateMachine', () => { ...@@ -118,7 +118,7 @@ describe('applicationStateMachine', () => {
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS} ${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS} ${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }} ${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: INSTALLED, status: INSTALLED,
...@@ -136,7 +136,7 @@ describe('applicationStateMachine', () => { ...@@ -136,7 +136,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects expectedState | event | effects
${INSTALLED} | ${UPDATED} | ${{ updateSuccessful: true }} ${INSTALLED} | ${UPDATED} | ${{ updateSuccessful: true }}
${INSTALLED} | ${UPDATE_ERRORED} | ${{ updateFailed: true }} ${INSTALLED} | ${UPDATE_ERRORED} | ${{ updateFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: UPDATING, status: UPDATING,
...@@ -154,7 +154,7 @@ describe('applicationStateMachine', () => { ...@@ -154,7 +154,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects expectedState | event | effects
${INSTALLABLE} | ${INSTALLABLE} | ${{ uninstallSuccessful: true }} ${INSTALLABLE} | ${INSTALLABLE} | ${{ uninstallSuccessful: true }}
${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }} ${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: UNINSTALLING, status: UNINSTALLING,
...@@ -172,7 +172,7 @@ describe('applicationStateMachine', () => { ...@@ -172,7 +172,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects expectedState | event | effects
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS} ${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }} ${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => { `(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data; const { expectedState, event, effects } = data;
const currentAppState = { const currentAppState = {
status: UNINSTALLED, status: UNINSTALLED,
......
...@@ -5,7 +5,7 @@ import NodeErrorHelpText from '~/clusters_list/components/node_error_help_text.v ...@@ -5,7 +5,7 @@ import NodeErrorHelpText from '~/clusters_list/components/node_error_help_text.v
describe('NodeErrorHelpText', () => { describe('NodeErrorHelpText', () => {
let wrapper; let wrapper;
const createWrapper = propsData => { const createWrapper = (propsData) => {
wrapper = shallowMount(NodeErrorHelpText, { propsData, stubs: { GlPopover } }); wrapper = shallowMount(NodeErrorHelpText, { propsData, stubs: { GlPopover } });
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}; };
......
...@@ -24,7 +24,7 @@ describe('Clusters store actions', () => { ...@@ -24,7 +24,7 @@ describe('Clusters store actions', () => {
captureException.mockRestore(); captureException.mockRestore();
}); });
it('should report sentry error', done => { it('should report sentry error', (done) => {
const sentryError = new Error('New Sentry Error'); const sentryError = new Error('New Sentry Error');
const tag = 'sentryErrorTag'; const tag = 'sentryErrorTag';
...@@ -62,7 +62,7 @@ describe('Clusters store actions', () => { ...@@ -62,7 +62,7 @@ describe('Clusters store actions', () => {
afterEach(() => mock.restore()); afterEach(() => mock.restore());
it('should commit SET_CLUSTERS_DATA with received response', done => { it('should commit SET_CLUSTERS_DATA with received response', (done) => {
mock.onGet().reply(200, apiData, headers); mock.onGet().reply(200, apiData, headers);
testAction( testAction(
...@@ -79,7 +79,7 @@ describe('Clusters store actions', () => { ...@@ -79,7 +79,7 @@ describe('Clusters store actions', () => {
); );
}); });
it('should show flash on API error', done => { it('should show flash on API error', (done) => {
mock.onGet().reply(400, 'Not Found'); mock.onGet().reply(400, 'Not Found');
testAction( testAction(
...@@ -126,7 +126,7 @@ describe('Clusters store actions', () => { ...@@ -126,7 +126,7 @@ describe('Clusters store actions', () => {
pollStop.mockRestore(); pollStop.mockRestore();
}); });
it('should stop polling after MAX Requests', done => { it('should stop polling after MAX Requests', (done) => {
testAction( testAction(
actions.fetchClusters, actions.fetchClusters,
{ endpoint: apiData.endpoint }, { endpoint: apiData.endpoint },
...@@ -173,7 +173,7 @@ describe('Clusters store actions', () => { ...@@ -173,7 +173,7 @@ describe('Clusters store actions', () => {
); );
}); });
it('should stop polling and report to Sentry when data is invalid', done => { it('should stop polling and report to Sentry when data is invalid', (done) => {
const badApiResponse = { clusters: {} }; const badApiResponse = { clusters: {} };
mock.onGet().reply(200, badApiResponse, pollHeaders); mock.onGet().reply(200, badApiResponse, pollHeaders);
......
...@@ -8,7 +8,7 @@ jest.mock('~/code_navigation/utils'); ...@@ -8,7 +8,7 @@ jest.mock('~/code_navigation/utils');
describe('Code navigation actions', () => { describe('Code navigation actions', () => {
describe('setInitialData', () => { describe('setInitialData', () => {
it('commits SET_INITIAL_DATA', done => { it('commits SET_INITIAL_DATA', (done) => {
testAction( testAction(
actions.setInitialData, actions.setInitialData,
{ projectPath: 'test' }, { projectPath: 'test' },
...@@ -57,7 +57,7 @@ describe('Code navigation actions', () => { ...@@ -57,7 +57,7 @@ describe('Code navigation actions', () => {
]); ]);
}); });
it('commits REQUEST_DATA_SUCCESS with normalized data', done => { it('commits REQUEST_DATA_SUCCESS with normalized data', (done) => {
testAction( testAction(
actions.fetchData, actions.fetchData,
null, null,
...@@ -84,7 +84,7 @@ describe('Code navigation actions', () => { ...@@ -84,7 +84,7 @@ describe('Code navigation actions', () => {
); );
}); });
it('calls addInteractionClass with data', done => { it('calls addInteractionClass with data', (done) => {
testAction( testAction(
actions.fetchData, actions.fetchData,
null, null,
...@@ -125,7 +125,7 @@ describe('Code navigation actions', () => { ...@@ -125,7 +125,7 @@ describe('Code navigation actions', () => {
mock.onGet(codeNavigationPath).replyOnce(500); mock.onGet(codeNavigationPath).replyOnce(500);
}); });
it('dispatches requestDataError', done => { it('dispatches requestDataError', (done) => {
testAction( testAction(
actions.fetchData, actions.fetchData,
null, null,
...@@ -175,15 +175,15 @@ describe('Code navigation actions', () => { ...@@ -175,15 +175,15 @@ describe('Code navigation actions', () => {
target = document.querySelector('.js-test'); target = document.querySelector('.js-test');
}); });
it('returns early when no data exists', done => { it('returns early when no data exists', (done) => {
testAction(actions.showDefinition, { target }, {}, [], [], done); testAction(actions.showDefinition, { target }, {}, [], [], done);
}); });
it('commits SET_CURRENT_DEFINITION when target is not code navitation element', done => { it('commits SET_CURRENT_DEFINITION when target is not code navitation element', (done) => {
testAction(actions.showDefinition, { target }, { data: {} }, [], [], done); testAction(actions.showDefinition, { target }, { data: {} }, [], [], done);
}); });
it('commits SET_CURRENT_DEFINITION with LSIF data', done => { it('commits SET_CURRENT_DEFINITION with LSIF data', (done) => {
target.classList.add('js-code-navigation'); target.classList.add('js-code-navigation');
target.setAttribute('data-line-index', '0'); target.setAttribute('data-line-index', '0');
target.setAttribute('data-char-index', '0'); target.setAttribute('data-char-index', '0');
......
...@@ -62,7 +62,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -62,7 +62,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
).toBe('Add a to do'); ).toBe('Add a to do');
}); });
it('toggle todo state', done => { it('toggle todo state', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click(); document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => { setImmediate(() => {
...@@ -80,7 +80,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -80,7 +80,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
}); });
}); });
it('toggle todo state of expanded todo toggle', done => { it('toggle todo state of expanded todo toggle', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click(); document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => { setImmediate(() => {
...@@ -92,7 +92,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -92,7 +92,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
}); });
}); });
it('toggles todo button tooltip', done => { it('toggles todo button tooltip', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click(); document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => { setImmediate(() => {
...@@ -106,7 +106,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -106,7 +106,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
}); });
}); });
it('marks todo as done', done => { it('marks todo as done', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click(); document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
waitForPromises() waitForPromises()
...@@ -131,7 +131,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -131,7 +131,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('updates aria-label to Mark as done', done => { it('updates aria-label to Mark as done', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click(); document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => { setImmediate(() => {
...@@ -145,7 +145,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -145,7 +145,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
}); });
}); });
it('updates aria-label to add todo', done => { it('updates aria-label to add todo', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click(); document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
waitForPromises() waitForPromises()
......
...@@ -105,7 +105,7 @@ describe('Commit pipeline status component', () => { ...@@ -105,7 +105,7 @@ describe('Commit pipeline status component', () => {
describe('when polling', () => { describe('when polling', () => {
let pollConfig; let pollConfig;
beforeEach(() => { beforeEach(() => {
Poll.mockImplementation(config => { Poll.mockImplementation((config) => {
pollConfig = config; pollConfig = config;
return { makeRequest: jest.fn(), restart: jest.fn(), stop: jest.fn() }; return { makeRequest: jest.fn(), restart: jest.fn(), stop: jest.fn() };
}); });
......
...@@ -31,7 +31,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -31,7 +31,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const { pipelines } = getJSONFixture(jsonFixtureName); const { pipelines } = getJSONFixture(jsonFixtureName);
PipelinesTable = Vue.extend(pipelinesTable); PipelinesTable = Vue.extend(pipelinesTable);
pipeline = pipelines.find(p => p.user !== null && p.commit !== null); pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
}); });
afterEach(() => { afterEach(() => {
...@@ -47,7 +47,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -47,7 +47,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props); vm = mountComponent(PipelinesTable, props);
}); });
it('should render the empty state', done => { it('should render the empty state', (done) => {
setImmediate(() => { setImmediate(() => {
expect(vm.$el.querySelector('.empty-state')).toBeDefined(); expect(vm.$el.querySelector('.empty-state')).toBeDefined();
expect(vm.$el.querySelector('.realtime-loading')).toBe(null); expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
...@@ -63,7 +63,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -63,7 +63,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props); vm = mountComponent(PipelinesTable, props);
}); });
it('should render a table with the received pipelines', done => { it('should render a table with the received pipelines', (done) => {
setImmediate(() => { setImmediate(() => {
expect(vm.$el.querySelectorAll('.ci-table .commit').length).toEqual(1); expect(vm.$el.querySelectorAll('.ci-table .commit').length).toEqual(1);
expect(vm.$el.querySelector('.realtime-loading')).toBe(null); expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
...@@ -74,7 +74,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -74,7 +74,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
describe('with pagination', () => { describe('with pagination', () => {
it('should make an API request when using pagination', done => { it('should make an API request when using pagination', (done) => {
setImmediate(() => { setImmediate(() => {
jest.spyOn(vm, 'updateContent').mockImplementation(() => {}); jest.spyOn(vm, 'updateContent').mockImplementation(() => {});
...@@ -102,11 +102,11 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -102,11 +102,11 @@ describe('Pipelines table in Commits and Merge requests', () => {
mock.onGet('endpoint.json').reply(200, [pipeline]); mock.onGet('endpoint.json').reply(200, [pipeline]);
}); });
it('should receive update-pipelines-count event', done => { it('should receive update-pipelines-count event', (done) => {
const element = document.createElement('div'); const element = document.createElement('div');
document.body.appendChild(element); document.body.appendChild(element);
element.addEventListener('update-pipelines-count', event => { element.addEventListener('update-pipelines-count', (event) => {
expect(event.detail.pipelines).toEqual([pipeline]); expect(event.detail.pipelines).toEqual([pipeline]);
done(); done();
}); });
...@@ -126,7 +126,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -126,7 +126,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
describe('when latest pipeline has detached flag', () => { describe('when latest pipeline has detached flag', () => {
it('renders the run pipeline button', done => { it('renders the run pipeline button', (done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true; pipelineCopy.flags.detached_merge_request_pipeline = true;
pipelineCopy.flags.merge_request_pipeline = true; pipelineCopy.flags.merge_request_pipeline = true;
...@@ -143,7 +143,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -143,7 +143,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
describe('when latest pipeline does not have detached flag', () => { describe('when latest pipeline does not have detached flag', () => {
it('does not render the run pipeline button', done => { it('does not render the run pipeline button', (done) => {
pipelineCopy.flags.detached_merge_request_pipeline = false; pipelineCopy.flags.detached_merge_request_pipeline = false;
pipelineCopy.flags.merge_request_pipeline = false; pipelineCopy.flags.merge_request_pipeline = false;
...@@ -163,7 +163,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -163,7 +163,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const findModal = () => const findModal = () =>
document.querySelector('#create-pipeline-for-fork-merge-request-modal'); document.querySelector('#create-pipeline-for-fork-merge-request-modal');
beforeEach(done => { beforeEach((done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true; pipelineCopy.flags.detached_merge_request_pipeline = true;
mock.onGet('endpoint.json').reply(200, [pipelineCopy]); mock.onGet('endpoint.json').reply(200, [pipelineCopy]);
...@@ -182,7 +182,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -182,7 +182,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
}); });
it('on desktop, shows a loading button', done => { it('on desktop, shows a loading button', (done) => {
findRunPipelineBtn().click(); findRunPipelineBtn().click();
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -200,7 +200,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -200,7 +200,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
}); });
it('on mobile, shows a loading button', done => { it('on mobile, shows a loading button', (done) => {
findRunPipelineBtnMobile().click(); findRunPipelineBtnMobile().click();
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -223,7 +223,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -223,7 +223,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const findModal = () => const findModal = () =>
document.querySelector('#create-pipeline-for-fork-merge-request-modal'); document.querySelector('#create-pipeline-for-fork-merge-request-modal');
beforeEach(done => { beforeEach((done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true; pipelineCopy.flags.detached_merge_request_pipeline = true;
mock.onGet('endpoint.json').reply(200, [pipelineCopy]); mock.onGet('endpoint.json').reply(200, [pipelineCopy]);
...@@ -244,7 +244,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -244,7 +244,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
}); });
it('on desktop, shows a security warning modal', done => { it('on desktop, shows a security warning modal', (done) => {
findRunPipelineBtn().click(); findRunPipelineBtn().click();
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -253,7 +253,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -253,7 +253,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
}); });
}); });
it('on mobile, shows a security warning modal', done => { it('on mobile, shows a security warning modal', (done) => {
findRunPipelineBtnMobile().click(); findRunPipelineBtnMobile().click();
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -271,7 +271,7 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -271,7 +271,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props); vm = mountComponent(PipelinesTable, props);
}); });
it('should render error state', done => { it('should render error state', (done) => {
setImmediate(() => { setImmediate(() => {
expect(vm.$el.querySelector('.js-pipelines-error-state')).toBeDefined(); expect(vm.$el.querySelector('.js-pipelines-error-state')).toBeDefined();
expect(vm.$el.querySelector('.realtime-loading')).toBe(null); expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......
...@@ -70,7 +70,7 @@ describe('Commits List', () => { ...@@ -70,7 +70,7 @@ describe('Commits List', () => {
mock.restore(); mock.restore();
}); });
it('should save the last search string', done => { it('should save the last search string', (done) => {
commitsList.searchField.val('GitLab'); commitsList.searchField.val('GitLab');
commitsList commitsList
.filterResults() .filterResults()
...@@ -83,7 +83,7 @@ describe('Commits List', () => { ...@@ -83,7 +83,7 @@ describe('Commits List', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('should not make ajax call if the input does not change', done => { it('should not make ajax call if the input does not change', (done) => {
commitsList commitsList
.filterResults() .filterResults()
.then(() => { .then(() => {
......
...@@ -29,7 +29,7 @@ describe('ConfirmModal', () => { ...@@ -29,7 +29,7 @@ describe('ConfirmModal', () => {
beforeEach(() => { beforeEach(() => {
const buttonContainer = document.createElement('div'); const buttonContainer = document.createElement('div');
buttons.forEach(x => { buttons.forEach((x) => {
const button = document.createElement('button'); const button = document.createElement('button');
button.setAttribute('class', 'js-confirm-modal-button'); button.setAttribute('class', 'js-confirm-modal-button');
button.setAttribute('data-path', x.path); button.setAttribute('data-path', x.path);
...@@ -50,7 +50,7 @@ describe('ConfirmModal', () => { ...@@ -50,7 +50,7 @@ describe('ConfirmModal', () => {
const findModal = () => document.querySelector('.gl-modal'); const findModal = () => document.querySelector('.gl-modal');
const findModalOkButton = (modal, variant) => const findModalOkButton = (modal, variant) =>
modal.querySelector(`.modal-footer .btn-${variant}`); modal.querySelector(`.modal-footer .btn-${variant}`);
const findModalCancelButton = modal => modal.querySelector('.modal-footer .btn-secondary'); const findModalCancelButton = (modal) => modal.querySelector('.modal-footer .btn-secondary');
const modalIsHidden = () => findModal() === null; const modalIsHidden = () => findModal() === null;
const serializeModal = (modal, buttonIndex) => { const serializeModal = (modal, buttonIndex) => {
...@@ -63,7 +63,7 @@ describe('ConfirmModal', () => { ...@@ -63,7 +63,7 @@ describe('ConfirmModal', () => {
title: modal.querySelector('.modal-title').innerHTML, title: modal.querySelector('.modal-title').innerHTML,
message: modal.querySelector('.modal-body div').innerHTML, message: modal.querySelector('.modal-body div').innerHTML,
okVariant: [...findModalOkButton(modal, modalAttributes.okVariant).classList] okVariant: [...findModalOkButton(modal, modalAttributes.okVariant).classList]
.find(x => x.match('btn-')) .find((x) => x.match('btn-'))
.replace('btn-', ''), .replace('btn-', ''),
okTitle: findModalOkButton(modal, modalAttributes.okVariant).innerHTML, okTitle: findModalOkButton(modal, modalAttributes.okVariant).innerHTML,
}, },
......
...@@ -17,7 +17,7 @@ describe('Contributors store actions', () => { ...@@ -17,7 +17,7 @@ describe('Contributors store actions', () => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
}); });
it('should commit SET_CHART_DATA with received response', done => { it('should commit SET_CHART_DATA with received response', (done) => {
mock.onGet().reply(200, chartData); mock.onGet().reply(200, chartData);
testAction( testAction(
...@@ -37,7 +37,7 @@ describe('Contributors store actions', () => { ...@@ -37,7 +37,7 @@ describe('Contributors store actions', () => {
); );
}); });
it('should show flash on API error', done => { it('should show flash on API error', (done) => {
mock.onGet().reply(400, 'Not Found'); mock.onGet().reply(400, 'Not Found');
testAction( testAction(
......
...@@ -128,7 +128,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -128,7 +128,7 @@ describe('EksClusterConfigurationForm', () => {
}); });
}; };
const createValidStateStore = initialState => { const createValidStateStore = (initialState) => {
createStore({ createStore({
initialState: { initialState: {
clusterName: 'cluster name', clusterName: 'cluster name',
......
...@@ -94,7 +94,7 @@ describe('EKS Cluster Store Actions', () => { ...@@ -94,7 +94,7 @@ describe('EKS Cluster Store Actions', () => {
${'setNodeCount'} | ${SET_NODE_COUNT} | ${{ nodeCount }} | ${'node count'} ${'setNodeCount'} | ${SET_NODE_COUNT} | ${{ nodeCount }} | ${'node count'}
${'setGitlabManagedCluster'} | ${SET_GITLAB_MANAGED_CLUSTER} | ${gitlabManagedCluster} | ${'gitlab managed cluster'} ${'setGitlabManagedCluster'} | ${SET_GITLAB_MANAGED_CLUSTER} | ${gitlabManagedCluster} | ${'gitlab managed cluster'}
${'setNamespacePerEnvironment'} | ${SET_NAMESPACE_PER_ENVIRONMENT} | ${namespacePerEnvironment} | ${'namespace per environment'} ${'setNamespacePerEnvironment'} | ${SET_NAMESPACE_PER_ENVIRONMENT} | ${namespacePerEnvironment} | ${'namespace per environment'}
`(`$action commits $mutation with $payloadDescription payload`, data => { `(`$action commits $mutation with $payloadDescription payload`, (data) => {
const { action, mutation, payload } = data; const { action, mutation, payload } = data;
testAction(actions[action], payload, state, [{ type: mutation, payload }]); testAction(actions[action], payload, state, [{ type: mutation, payload }]);
......
...@@ -6,7 +6,7 @@ describe('EKS Cluster Store Getters', () => { ...@@ -6,7 +6,7 @@ describe('EKS Cluster Store Getters', () => {
expect(subnetValid({ selectedSubnet: [1, 2] })).toBe(true); expect(subnetValid({ selectedSubnet: [1, 2] })).toBe(true);
}); });
it.each([[[], [1]]])('returns false if there are 1 or less selected subnets', subnets => { it.each([[[], [1]]])('returns false if there are 1 or less selected subnets', (subnets) => {
expect(subnetValid({ selectedSubnet: subnets })).toBe(false); expect(subnetValid({ selectedSubnet: subnets })).toBe(false);
}); });
}); });
......
...@@ -66,7 +66,7 @@ describe('Create EKS cluster store mutations', () => { ...@@ -66,7 +66,7 @@ describe('Create EKS cluster store mutations', () => {
${SET_INSTANCE_TYPE} | ${'selectedInstanceType'} | ${{ instanceType }} | ${instanceType} | ${'selected instance type payload'} ${SET_INSTANCE_TYPE} | ${'selectedInstanceType'} | ${{ instanceType }} | ${instanceType} | ${'selected instance type payload'}
${SET_NODE_COUNT} | ${'nodeCount'} | ${{ nodeCount }} | ${nodeCount} | ${'node count payload'} ${SET_NODE_COUNT} | ${'nodeCount'} | ${{ nodeCount }} | ${nodeCount} | ${'node count payload'}
${SET_GITLAB_MANAGED_CLUSTER} | ${'gitlabManagedCluster'} | ${{ gitlabManagedCluster }} | ${gitlabManagedCluster} | ${'gitlab managed cluster'} ${SET_GITLAB_MANAGED_CLUSTER} | ${'gitlabManagedCluster'} | ${{ gitlabManagedCluster }} | ${gitlabManagedCluster} | ${'gitlab managed cluster'}
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, data => { `(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => {
const { mutation, mutatedProperty, payload, expectedValue } = data; const { mutation, mutatedProperty, payload, expectedValue } = data;
mutations[mutation](state, payload); mutations[mutation](state, payload);
......
...@@ -8,7 +8,7 @@ const cloudbilling = { ...@@ -8,7 +8,7 @@ const cloudbilling = {
projects: { projects: {
getBillingInfo: jest.fn( getBillingInfo: jest.fn(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
resolve({ resolve({
result: { billingEnabled: true }, result: { billingEnabled: true },
}); });
...@@ -21,7 +21,7 @@ const cloudresourcemanager = { ...@@ -21,7 +21,7 @@ const cloudresourcemanager = {
projects: { projects: {
list: jest.fn( list: jest.fn(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
resolve({ resolve({
result: { ...gapiProjectsResponseMock }, result: { ...gapiProjectsResponseMock },
}); });
...@@ -34,7 +34,7 @@ const compute = { ...@@ -34,7 +34,7 @@ const compute = {
zones: { zones: {
list: jest.fn( list: jest.fn(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
resolve({ resolve({
result: { ...gapiZonesResponseMock }, result: { ...gapiZonesResponseMock },
}); });
...@@ -44,7 +44,7 @@ const compute = { ...@@ -44,7 +44,7 @@ const compute = {
machineTypes: { machineTypes: {
list: jest.fn( list: jest.fn(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
resolve({ resolve({
result: { ...gapiMachineTypesResponseMock }, result: { ...gapiMachineTypesResponseMock },
}); });
......
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
describe('GCP Cluster Dropdown Store Actions', () => { describe('GCP Cluster Dropdown Store Actions', () => {
describe('setProject', () => { describe('setProject', () => {
it('should set project', done => { it('should set project', (done) => {
testAction( testAction(
actions.setProject, actions.setProject,
selectedProjectMock, selectedProjectMock,
...@@ -27,7 +27,7 @@ describe('GCP Cluster Dropdown Store Actions', () => { ...@@ -27,7 +27,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
}); });
describe('setZone', () => { describe('setZone', () => {
it('should set zone', done => { it('should set zone', (done) => {
testAction( testAction(
actions.setZone, actions.setZone,
selectedZoneMock, selectedZoneMock,
...@@ -40,7 +40,7 @@ describe('GCP Cluster Dropdown Store Actions', () => { ...@@ -40,7 +40,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
}); });
describe('setMachineType', () => { describe('setMachineType', () => {
it('should set machine type', done => { it('should set machine type', (done) => {
testAction( testAction(
actions.setMachineType, actions.setMachineType,
selectedMachineTypeMock, selectedMachineTypeMock,
...@@ -53,7 +53,7 @@ describe('GCP Cluster Dropdown Store Actions', () => { ...@@ -53,7 +53,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
}); });
describe('setIsValidatingProjectBilling', () => { describe('setIsValidatingProjectBilling', () => {
it('should set machine type', done => { it('should set machine type', (done) => {
testAction( testAction(
actions.setIsValidatingProjectBilling, actions.setIsValidatingProjectBilling,
true, true,
...@@ -92,7 +92,7 @@ describe('GCP Cluster Dropdown Store Actions', () => { ...@@ -92,7 +92,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
}); });
describe('validateProjectBilling', () => { describe('validateProjectBilling', () => {
it('checks project billing status from Google API', done => { it('checks project billing status from Google API', (done) => {
testAction( testAction(
actions.validateProjectBilling, actions.validateProjectBilling,
true, true,
......
...@@ -2,8 +2,8 @@ import initGkeNamespace from '~/create_cluster/gke_cluster_namespace'; ...@@ -2,8 +2,8 @@ import initGkeNamespace from '~/create_cluster/gke_cluster_namespace';
describe('GKE cluster namespace', () => { describe('GKE cluster namespace', () => {
const changeEvent = new Event('change'); const changeEvent = new Event('change');
const isHidden = el => el.classList.contains('hidden'); const isHidden = (el) => el.classList.contains('hidden');
const hasDisabledInput = el => el.querySelector('input').disabled; const hasDisabledInput = (el) => el.querySelector('input').disabled;
let glManagedCheckbox; let glManagedCheckbox;
let selfManaged; let selfManaged;
......
...@@ -27,7 +27,7 @@ describe('Cluster dropdown store mutations', () => { ...@@ -27,7 +27,7 @@ describe('Cluster dropdown store mutations', () => {
${RECEIVE_ITEMS_SUCCESS} | ${'items'} | ${{ items }} | ${items} | ${'items payload'} ${RECEIVE_ITEMS_SUCCESS} | ${'items'} | ${{ items }} | ${items} | ${'items payload'}
${RECEIVE_ITEMS_ERROR} | ${'isLoadingItems'} | ${{ error }} | ${false} | ${false} ${RECEIVE_ITEMS_ERROR} | ${'isLoadingItems'} | ${{ error }} | ${false} | ${false}
${RECEIVE_ITEMS_ERROR} | ${'error'} | ${{ error }} | ${error} | ${'received error object'} ${RECEIVE_ITEMS_ERROR} | ${'error'} | ${{ error }} | ${error} | ${'received error object'}
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, data => { `(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => {
const { mutation, mutatedProperty, payload, expectedValue } = data; const { mutation, mutatedProperty, payload, expectedValue } = data;
mutations[mutation](state, payload); mutations[mutation](state, payload);
......
...@@ -162,7 +162,7 @@ describe('CreateItemDropdown', () => { ...@@ -162,7 +162,7 @@ describe('CreateItemDropdown', () => {
getData: (term, callback) => { getData: (term, callback) => {
callback(DROPDOWN_ITEM_DATA); callback(DROPDOWN_ITEM_DATA);
}, },
createNewItemFromValue: newValue => ({ createNewItemFromValue: (newValue) => ({
title: `${newValue}-title`, title: `${newValue}-title`,
id: `${newValue}-id`, id: `${newValue}-id`,
text: `${newValue}-text`, text: `${newValue}-text`,
......
...@@ -36,7 +36,7 @@ describe('CreateMergeRequestDropdown', () => { ...@@ -36,7 +36,7 @@ describe('CreateMergeRequestDropdown', () => {
}); });
describe('getRef', () => { describe('getRef', () => {
it('escapes branch names correctly', done => { it('escapes branch names correctly', (done) => {
const endpoint = `${dropdown.refsPath}contains%23hash`; const endpoint = `${dropdown.refsPath}contains%23hash`;
jest.spyOn(axios, 'get'); jest.spyOn(axios, 'get');
axiosMock.onGet(endpoint).replyOnce({}); axiosMock.onGet(endpoint).replyOnce({});
......
...@@ -11,7 +11,7 @@ describe('custom metrics form fields component', () => { ...@@ -11,7 +11,7 @@ describe('custom metrics form fields component', () => {
let component; let component;
let mockAxios; let mockAxios;
const getNamedInput = name => component.element.querySelector(`input[name="${name}"]`); const getNamedInput = (name) => component.element.querySelector(`input[name="${name}"]`);
const validateQueryPath = `${TEST_HOST}/mock/path`; const validateQueryPath = `${TEST_HOST}/mock/path`;
const validQueryResponse = { data: { success: true, query: { valid: true, error: '' } } }; const validQueryResponse = { data: { success: true, query: { valid: true, error: '' } } };
const csrfToken = 'mockToken'; const csrfToken = 'mockToken';
...@@ -50,7 +50,7 @@ describe('custom metrics form fields component', () => { ...@@ -50,7 +50,7 @@ describe('custom metrics form fields component', () => {
mockAxios.restore(); mockAxios.restore();
}); });
it('checks form validity', done => { it('checks form validity', (done) => {
mountComponent({ mountComponent({
metricPersisted: true, metricPersisted: true,
...makeFormData({ ...makeFormData({
...@@ -157,7 +157,7 @@ describe('custom metrics form fields component', () => { ...@@ -157,7 +157,7 @@ describe('custom metrics form fields component', () => {
{ {
requestValidation: jest.fn().mockImplementation( requestValidation: jest.fn().mockImplementation(
() => () =>
new Promise(resolve => new Promise((resolve) =>
setTimeout(() => { setTimeout(() => {
resolve(validQueryResponse); resolve(validQueryResponse);
}, 4000), }, 4000),
...@@ -171,7 +171,7 @@ describe('custom metrics form fields component', () => { ...@@ -171,7 +171,7 @@ describe('custom metrics form fields component', () => {
jest.clearAllTimers(); jest.clearAllTimers();
}); });
it('expect queryValidateInFlight is in flight', done => { it('expect queryValidateInFlight is in flight', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`); const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query'); queryInput.setValue('query');
queryInput.trigger('input'); queryInput.trigger('input');
...@@ -191,7 +191,7 @@ describe('custom metrics form fields component', () => { ...@@ -191,7 +191,7 @@ describe('custom metrics form fields component', () => {
}); });
}); });
it('expect loading message to display', done => { it('expect loading message to display', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`); const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query'); queryInput.setValue('query');
queryInput.trigger('input'); queryInput.trigger('input');
...@@ -202,7 +202,7 @@ describe('custom metrics form fields component', () => { ...@@ -202,7 +202,7 @@ describe('custom metrics form fields component', () => {
}); });
}); });
it('expect loading message to disappear', done => { it('expect loading message to disappear', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`); const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query'); queryInput.setValue('query');
queryInput.trigger('input'); queryInput.trigger('input');
...@@ -239,7 +239,7 @@ describe('custom metrics form fields component', () => { ...@@ -239,7 +239,7 @@ describe('custom metrics form fields component', () => {
); );
}); });
it('sets queryIsValid to false', done => { it('sets queryIsValid to false', (done) => {
component.vm.$nextTick(() => { component.vm.$nextTick(() => {
expect(component.vm.queryValidateInFlight).toBe(false); expect(component.vm.queryValidateInFlight).toBe(false);
expect(component.vm.queryIsValid).toBe(false); expect(component.vm.queryIsValid).toBe(false);
...@@ -247,7 +247,7 @@ describe('custom metrics form fields component', () => { ...@@ -247,7 +247,7 @@ describe('custom metrics form fields component', () => {
}); });
}); });
it('shows invalid query message', done => { it('shows invalid query message', (done) => {
component.vm.$nextTick(() => { component.vm.$nextTick(() => {
expect(component.text()).toContain(errorMessage); expect(component.text()).toContain(errorMessage);
done(); done();
...@@ -267,7 +267,7 @@ describe('custom metrics form fields component', () => { ...@@ -267,7 +267,7 @@ describe('custom metrics form fields component', () => {
); );
}); });
it('sets queryIsValid to true when query is valid', done => { it('sets queryIsValid to true when query is valid', (done) => {
component.vm.$nextTick(() => { component.vm.$nextTick(() => {
expect(component.vm.queryIsValid).toBe(true); expect(component.vm.queryIsValid).toBe(true);
done(); done();
......
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