Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-02 06:09:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-02 06:09:10 +0300
commit7580728fc297c86cc5a31fb67e7153217facf1c0 (patch)
tree59279991d34f28fc1b415a14e77df08d5c11d265 /spec/frontend/captcha
parentd8714cf67ce4db786b26b64f0f0bef50fb6976e6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/captcha')
-rw-r--r--spec/frontend/captcha/init_recaptcha_script_spec.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/spec/frontend/captcha/init_recaptcha_script_spec.js b/spec/frontend/captcha/init_recaptcha_script_spec.js
index 77f78d36991..df114821651 100644
--- a/spec/frontend/captcha/init_recaptcha_script_spec.js
+++ b/spec/frontend/captcha/init_recaptcha_script_spec.js
@@ -7,19 +7,11 @@ import {
describe('initRecaptchaScript', () => {
afterEach(() => {
- // NOTE: The DOM is guaranteed to be clean at the start of a new test file, but it isn't cleaned
- // between examples within a file, so we need to clean it after each one. See more context here:
- // - https://github.com/facebook/jest/issues/1224
- // - https://stackoverflow.com/questions/42805128/does-jest-reset-the-jsdom-document-after-every-suite-or-test
- //
- // Also note as mentioned in https://github.com/facebook/jest/issues/1224#issuecomment-444586798
- // that properties of `window` are NOT cleared between test files. So, we are also
- // explicitly unsetting it.
document.head.innerHTML = '';
- window[RECAPTCHA_ONLOAD_CALLBACK_NAME] = undefined;
clearMemoizeCache();
});
+ const getScriptOnload = () => window[RECAPTCHA_ONLOAD_CALLBACK_NAME];
const triggerScriptOnload = (...args) => window[RECAPTCHA_ONLOAD_CALLBACK_NAME](...args);
describe('when called', () => {
@@ -51,6 +43,7 @@ describe('initRecaptchaScript', () => {
triggerScriptOnload(instance);
await expect(result).resolves.toBe(instance);
+ expect(getScriptOnload()).toBeUndefined();
});
});
});