diff options
Diffstat (limited to 'spec/frontend/dirty_submit')
-rw-r--r-- | spec/frontend/dirty_submit/dirty_submit_collection_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/dirty_submit/dirty_submit_form_spec.js | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/frontend/dirty_submit/dirty_submit_collection_spec.js b/spec/frontend/dirty_submit/dirty_submit_collection_spec.js index 170d581be23..465391633e6 100644 --- a/spec/frontend/dirty_submit/dirty_submit_collection_spec.js +++ b/spec/frontend/dirty_submit/dirty_submit_collection_spec.js @@ -1,15 +1,15 @@ import DirtySubmitCollection from '~/dirty_submit/dirty_submit_collection'; import { setInputValue, createForm } from './helper'; -jest.mock('lodash/throttle', () => jest.fn(fn => fn)); +jest.mock('lodash/throttle', () => jest.fn((fn) => fn)); describe('DirtySubmitCollection', () => { const testElementsCollection = [createForm(), createForm()]; - const forms = testElementsCollection.map(testElements => testElements.form); + const forms = testElementsCollection.map((testElements) => testElements.form); new DirtySubmitCollection(forms); // eslint-disable-line no-new - it.each(testElementsCollection)('disables submits until there are changes', testElements => { + it.each(testElementsCollection)('disables submits until there are changes', (testElements) => { const { input, submit } = testElements; const originalValue = input.value; diff --git a/spec/frontend/dirty_submit/dirty_submit_form_spec.js b/spec/frontend/dirty_submit/dirty_submit_form_spec.js index d7f690df1f3..cfcf1be609e 100644 --- a/spec/frontend/dirty_submit/dirty_submit_form_spec.js +++ b/spec/frontend/dirty_submit/dirty_submit_form_spec.js @@ -2,7 +2,7 @@ import { range as rge, throttle } from 'lodash'; import DirtySubmitForm from '~/dirty_submit/dirty_submit_form'; import { getInputValue, setInputValue, createForm } from './helper'; -jest.mock('lodash/throttle', () => jest.fn(fn => fn)); +jest.mock('lodash/throttle', () => jest.fn((fn) => fn)); const lodash = jest.requireActual('lodash'); function expectToToggleDisableOnDirtyUpdate(submit, input) { @@ -66,7 +66,7 @@ describe('DirtySubmitForm', () => { const { form, input } = createForm(); const updateDirtyInputSpy = jest.spyOn(new DirtySubmitForm(form), 'updateDirtyInput'); - rge(10).forEach(i => { + rge(10).forEach((i) => { setInputValue(input, `change ${i}`, false); }); @@ -78,13 +78,13 @@ describe('DirtySubmitForm', () => { it('does not throttle updates when rapid changes are made to different form elements', () => { const form = document.createElement('form'); const range = rge(10); - range.forEach(i => { + range.forEach((i) => { form.innerHTML += `<input type="text" name="input-${i}" class="js-input-${i}"/>`; }); const updateDirtyInputSpy = jest.spyOn(new DirtySubmitForm(form), 'updateDirtyInput'); - range.forEach(i => { + range.forEach((i) => { const input = form.querySelector(`.js-input-${i}`); setInputValue(input, `change`, false); }); |