diff --git a/tests/javascripts/preventDuplicateFormSubmissions.test.js b/tests/javascripts/preventDuplicateFormSubmissions.test.js index 09c63187d..09ec7e5d2 100644 --- a/tests/javascripts/preventDuplicateFormSubmissions.test.js +++ b/tests/javascripts/preventDuplicateFormSubmissions.test.js @@ -44,17 +44,20 @@ describe('Prevent duplicate form submissions', () => { }); - test("It should prevent the second click on the 'submit' button", () => { + test("It should prevent any clicks of the 'submit' button after the first one submitting the form", () => { + helpers.triggerEvent(button, 'click'); helpers.triggerEvent(button, 'click'); + expect(formEventSpy.mock.calls.length).toEqual(1); + }); test("It should allow clicks again after 1.5 seconds", () => { helpers.triggerEvent(button, 'click'); - jest.advanceTimersByTime(10000); + jest.advanceTimersByTime(1500); helpers.triggerEvent(button, 'click');