Remove Discourse constant usage (#10470)

* REFACTOR: Get us closer to no `Discourse` constants in tests

* REFACTOR: Remove `Discourse.currentUser`

* REFACTOR: `prioritizeNameInUx` is really a helper and can use context

* REFACTOR: Rename test

* REFACTOR: Remove `Discourse.MarkdownItURL` and use session

* REFACTOR: Remove unused `LetterAvatarVersion`

* REFACTOR: Remove unused `Discourse.ThemeSettings`

* REFACTOR: Remove unused CDN constants

* REFACTOR: The `globalNotice` property doesn't exist anymore

* REFACTOR: Remove `Discourse.__container__` from plugin api

* REFACTOR: Consider `logout()` a helper and remove container.
This commit is contained in:
Robin Ward
2020-08-19 08:51:48 -04:00
committed by GitHub
parent dde3d63b33
commit 3640c00b03
20 changed files with 67 additions and 82 deletions

View File

@ -5,7 +5,7 @@ import { later } from "@ember/runloop";
import sessionFixtures from "fixtures/session-fixtures";
import HeaderComponent from "discourse/components/site-header";
import { forceMobile, resetMobile } from "discourse/lib/mobile";
import { resetPluginApi } from "discourse/lib/plugin-api";
import { resetPluginApi, setPluginContainer } from "discourse/lib/plugin-api";
import {
clearCache as clearOutletCache,
resetExtraClasses
@ -173,6 +173,7 @@ export function acceptance(name, options) {
resetPluginApi();
Discourse.reset();
this.container = getOwner(this);
setPluginContainer(this.container);
if (options.beforeEach) {
options.beforeEach.call(this);
}