Skip to content

A platform for community discussion. Free, open, simple.

DEV: Clear clearToolbarCallbacks after each test (#17531)

Jarek Radosz751a5e1430e7
diff --git a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js
index 18b8efd440f..a7b2cb44568 100644
--- a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js
+++ b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js
@@ -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) {
diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js
index 417c412eaf2..3720f70b7fd 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js
@@ -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}} />`);