DEV: Clear clearToolbarCallbacks after each test (#17531)
Fixes leakage between tests. Have a composer toolbar with a 100 "Add emoji" buttons? I gotchu.
This commit is contained in:
parent
1b4dea75ee
commit
751a5e1430
|
@ -69,6 +69,7 @@ import {
|
|||
clearTagDecorateCallbacks,
|
||||
clearTextDecorateCallbacks,
|
||||
} from "discourse/lib/to-markdown";
|
||||
import { clearToolbarCallbacks } from "discourse/components/d-editor";
|
||||
|
||||
export function currentUser() {
|
||||
return User.create(sessionFixtures["/session/current.json"].current_user);
|
||||
|
@ -193,6 +194,7 @@ export function testCleanup(container, app) {
|
|||
clearTextDecorateCallbacks();
|
||||
clearResolverOptions();
|
||||
clearLegacyResolverOptions();
|
||||
clearToolbarCallbacks();
|
||||
}
|
||||
|
||||
export function discourseModule(name, options) {
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
} from "discourse/tests/helpers/textarea-selection-helper";
|
||||
import { hbs } from "ember-cli-htmlbars";
|
||||
import I18n from "I18n";
|
||||
import { clearToolbarCallbacks } from "discourse/components/d-editor";
|
||||
import formatTextWithSelection from "discourse/tests/helpers/d-editor-helper";
|
||||
import { next } from "@ember/runloop";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
|
@ -21,10 +20,6 @@ import { withPluginApi } from "discourse/lib/plugin-api";
|
|||
module("Integration | Component | d-editor", function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
hooks.afterEach(function () {
|
||||
clearToolbarCallbacks();
|
||||
});
|
||||
|
||||
test("preview updates with markdown", async function (assert) {
|
||||
await render(hbs`<DEditor @value={{this.value}} />`);
|
||||
|
||||
|
|
Loading…
Reference in New Issue