mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
`discourse-common` was created in the past to share logic between the 'wizard' app and the main 'discourse' app. Since then, the wizard has been consolidated into the main app, so the separation of `discourse-common` is no longer useful. This commit moves `discourse-common/(lib|utils)/*` into `discourse/lib/*`, adds shims for the imports, and updates existing uses in core.
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
import { visit } from "@ember/test-helpers";
|
|
import { compile } from "handlebars";
|
|
import { test } from "qunit";
|
|
import { withSilencedDeprecations } from "discourse/lib/deprecated";
|
|
import { addRawTemplate, removeRawTemplate } from "discourse/lib/raw-templates";
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
|
|
|
const CONNECTOR =
|
|
"javascripts/raw-test/connectors/topic-list-before-status/lala";
|
|
|
|
acceptance("Raw Plugin Outlet", function (needs) {
|
|
needs.hooks.beforeEach(function () {
|
|
withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => {
|
|
addRawTemplate(
|
|
CONNECTOR,
|
|
compile(`<span class='topic-lala'>{{context.topic.id}}</span>`)
|
|
);
|
|
});
|
|
});
|
|
|
|
needs.hooks.afterEach(function () {
|
|
removeRawTemplate(CONNECTOR);
|
|
});
|
|
|
|
test("Renders the raw plugin outlet", async function (assert) {
|
|
await visit("/");
|
|
assert.dom(".topic-lala").exists("renders the outlet");
|
|
assert.dom(".topic-lala").hasText("11557", "has the topic id");
|
|
});
|
|
});
|