DEV: Don't leak auth methods between tests (#14708)

This commit is contained in:
Jarek Radosz 2021-10-25 15:25:39 +02:00 committed by GitHub
parent d6c39e54cf
commit facf7d6f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -85,10 +85,8 @@ export function findAll() {
return methods;
}
methods = [];
Site.currentProp("auth_providers").forEach((provider) =>
methods.pushObject(LoginMethod.create(provider))
methods = Site.currentProp("auth_providers").map((provider) =>
LoginMethod.create(provider)
);
// exclude FA icon for Google, uses custom SVG
@ -97,4 +95,8 @@ export function findAll() {
return methods;
}
export function clearAuthMethods() {
methods = undefined;
}
export default LoginMethod;

View File

@ -52,6 +52,7 @@ import {
cleanUpComposerUploadProcessor,
} from "discourse/components/composer-editor";
import { resetLastEditNotificationClick } from "discourse/models/post-stream";
import { clearAuthMethods } from "discourse/models/login-method";
const LEGACY_ENV = !setupApplicationTest;
@ -295,6 +296,8 @@ export function acceptance(name, optionsOrCallback) {
cleanUpComposerUploadMarkdownResolver();
cleanUpComposerUploadPreProcessor();
resetLastEditNotificationClick();
clearAuthMethods();
app._runInitializer("instanceInitializers", (initName, initializer) => {
if (initializer && initializer.teardown) {
initializer.teardown(this.container);