mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
We used this flag for experimenting with admin plugin sidebars. We have now settled on a tabbed layout, and this is no longer needed. This PR simply ignores the flag in a backwards-compatible way, so we can discontinue usage in plugins and then remove the backwards-compatibility in core.
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
import { getOwner } from "@ember/owner";
|
|
import { render } from "@ember/test-helpers";
|
|
import { hbs } from "ember-cli-htmlbars";
|
|
import { module, test } from "qunit";
|
|
import { registerAdminPluginConfigNav } from "discourse/lib/admin-plugin-config-nav";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import AdminPlugin from "admin/models/admin-plugin";
|
|
|
|
module("Integration | Component | admin-plugin-config-area", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("it renders the nav items along the top", async function (assert) {
|
|
registerAdminPluginConfigNav("discourse-test-plugin", [
|
|
{
|
|
route: "adminPlugins.show.discourse-test-plugin.one",
|
|
label: "admin.title",
|
|
},
|
|
{
|
|
route: "adminPlugins.show.discourse-test-plugin.two",
|
|
label: "admin.back_to_forum",
|
|
},
|
|
]);
|
|
getOwner(this).lookup("service:admin-plugin-nav-manager").currentPlugin =
|
|
new AdminPlugin({ id: "discourse-test-plugin" });
|
|
|
|
await render(hbs`
|
|
<AdminPluginConfigArea>
|
|
Test content
|
|
</AdminPluginConfigArea>
|
|
`);
|
|
|
|
assert
|
|
.dom(".admin-plugin-inner-sidebar-nav__item")
|
|
.doesNotExist("renders the correct number of sidebar nav items");
|
|
|
|
assert
|
|
.dom(".admin-plugin-config-area")
|
|
.hasText("Test content", "renders the yielded content");
|
|
});
|
|
});
|