mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:40:00 +08:00
DEV: Clear all navItem
information between tests (#13903)
Expands the original `clearCustomNavItemHref` from #13025. Fixes issues with discourse-assign tests.
This commit is contained in:
parent
0ac2cfa68c
commit
f740c1a952
|
@ -301,8 +301,10 @@ export function customNavItemHref(cb) {
|
|||
NavItem.customNavItemHrefs.push(cb);
|
||||
}
|
||||
|
||||
export function clearCustomNavItemHref() {
|
||||
export function clearNavItems() {
|
||||
NavItem.customNavItemHrefs.clear();
|
||||
NavItem.extraArgsCallbacks.clear();
|
||||
NavItem.extraNavItemDescriptors.clear();
|
||||
}
|
||||
|
||||
export function addNavItem(item) {
|
||||
|
|
|
@ -40,7 +40,7 @@ import { setTopicList } from "discourse/lib/topic-list-tracker";
|
|||
import sinon from "sinon";
|
||||
import siteFixtures from "discourse/tests/fixtures/site-fixtures";
|
||||
import { clearResolverOptions } from "discourse-common/resolver";
|
||||
import { clearCustomNavItemHref } from "discourse/models/nav-item";
|
||||
import { clearNavItems } from "discourse/models/nav-item";
|
||||
import {
|
||||
cleanUpComposerUploadHandler,
|
||||
cleanUpComposerUploadMarkdownResolver,
|
||||
|
@ -274,7 +274,7 @@ export function acceptance(name, optionsOrCallback) {
|
|||
resetOneboxCache();
|
||||
resetCustomPostMessageCallbacks();
|
||||
resetUserSearchCache();
|
||||
clearCustomNavItemHref();
|
||||
clearNavItems();
|
||||
setTopicList(null);
|
||||
_clearSnapshots();
|
||||
setURLContainer(null);
|
||||
|
|
Loading…
Reference in New Issue
Block a user