DEV: Clear custom sidebar sections after each test (#17775)

Initializers are re-run before each test, so we need to clear out the list to avoid duplicates building up over multiple tests.
This commit is contained in:
David Taylor 2022-08-03 09:42:29 +01:00 committed by GitHub
parent d1d760ae7b
commit 36446649ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,7 @@ import {
} from "discourse/lib/to-markdown"; } from "discourse/lib/to-markdown";
import { clearTagsHtmlCallbacks } from "discourse/lib/render-tags"; import { clearTagsHtmlCallbacks } from "discourse/lib/render-tags";
import { clearToolbarCallbacks } from "discourse/components/d-editor"; import { clearToolbarCallbacks } from "discourse/components/d-editor";
import { resetSidebarSection } from "discourse/lib/sidebar/custom-sections";
export function currentUser() { export function currentUser() {
return User.create(sessionFixtures["/session/current.json"].current_user); return User.create(sessionFixtures["/session/current.json"].current_user);
@ -198,6 +199,7 @@ export function testCleanup(container, app) {
clearLegacyResolverOptions(); clearLegacyResolverOptions();
clearTagsHtmlCallbacks(); clearTagsHtmlCallbacks();
clearToolbarCallbacks(); clearToolbarCallbacks();
resetSidebarSection();
} }
export function discourseModule(name, options) { export function discourseModule(name, options) {