DEV: Clear tagsHtmlCallbacks after each test (#17530)

Fixes leakage between tests
This commit is contained in:
Jarek Radosz 2022-07-16 23:24:13 +02:00 committed by GitHub
parent 343b8dd7aa
commit 39c35ee47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,11 @@ export function addTagsHtmlCallback(callback, options) {
callbacks.splice(i, 0, callback); callbacks.splice(i, 0, callback);
} }
export function clearTagsHtmlCallbacks() {
callbacks = null;
priorities = null;
}
export default function (topic, params) { export default function (topic, params) {
let tags = topic.tags; let tags = topic.tags;
let buffer = ""; let buffer = "";

View File

@ -69,6 +69,7 @@ import {
clearTagDecorateCallbacks, clearTagDecorateCallbacks,
clearTextDecorateCallbacks, clearTextDecorateCallbacks,
} from "discourse/lib/to-markdown"; } from "discourse/lib/to-markdown";
import { clearTagsHtmlCallbacks } from "discourse/lib/render-tags";
import { clearToolbarCallbacks } from "discourse/components/d-editor"; import { clearToolbarCallbacks } from "discourse/components/d-editor";
export function currentUser() { export function currentUser() {
@ -194,6 +195,7 @@ export function testCleanup(container, app) {
clearTextDecorateCallbacks(); clearTextDecorateCallbacks();
clearResolverOptions(); clearResolverOptions();
clearLegacyResolverOptions(); clearLegacyResolverOptions();
clearTagsHtmlCallbacks();
clearToolbarCallbacks(); clearToolbarCallbacks();
} }