diff --git a/app/assets/javascripts/discourse/app/models/nav-item.js b/app/assets/javascripts/discourse/app/models/nav-item.js index d369d05f366..0293fbddf8b 100644 --- a/app/assets/javascripts/discourse/app/models/nav-item.js +++ b/app/assets/javascripts/discourse/app/models/nav-item.js @@ -301,6 +301,10 @@ export function customNavItemHref(cb) { NavItem.customNavItemHrefs.push(cb); } +export function clearCustomNavItemHref() { + NavItem.customNavItemHrefs.clear(); +} + export function addNavItem(item) { NavItem.extraNavItemDescriptors.push(item); } diff --git a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js index 8d0d251c706..826b5f24cd5 100644 --- a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js +++ b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js @@ -39,6 +39,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"; const LEGACY_ENV = !setupApplicationTest; @@ -260,6 +261,7 @@ export function acceptance(name, optionsOrCallback) { resetUsernameDecorators(); resetOneboxCache(); resetCustomPostMessageCallbacks(); + clearCustomNavItemHref(); setTopicList(null); _clearSnapshots(); setURLContainer(null);