From 9c5341dd0832c3af377191c461c800e1aa048b10 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 1 Aug 2022 12:12:10 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/frontend/lib/utils/rails_ujs_spec.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'spec/frontend/lib/utils/rails_ujs_spec.js') diff --git a/spec/frontend/lib/utils/rails_ujs_spec.js b/spec/frontend/lib/utils/rails_ujs_spec.js index c10301523c9..da9cc5c6f3c 100644 --- a/spec/frontend/lib/utils/rails_ujs_spec.js +++ b/spec/frontend/lib/utils/rails_ujs_spec.js @@ -18,14 +18,12 @@ function mockXHRResponse({ responseText, responseContentType } = {}) { .mockReturnValue(responseContentType); jest.spyOn(global.XMLHttpRequest.prototype, 'send').mockImplementation(function send() { - requestAnimationFrame(() => { - Object.defineProperties(this, { - readyState: { value: XMLHttpRequest.DONE }, - status: { value: 200 }, - response: { value: responseText }, - }); - this.onreadystatechange(); + Object.defineProperties(this, { + readyState: { value: XMLHttpRequest.DONE }, + status: { value: 200 }, + response: { value: responseText }, }); + this.onreadystatechange(); }); } -- cgit v1.2.1