DEV: Update tests to use new site settings (#102)

This commit is contained in:
Alan Guo Xiang Tan 2022-07-27 12:55:45 +08:00 committed by GitHub
parent 45386920ca
commit fc2750e1d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -47,9 +47,7 @@ export default {
}); });
withPluginApi("1.2.0", (api) => { withPluginApi("1.2.0", (api) => {
const currentUser = container.lookup("current-user:main"); if (siteSettings.enable_experimental_sidebar_hamburger) {
if (currentUser?.experimental_sidebar_enabled) {
api.addTopicsSectionLink({ api.addTopicsSectionLink({
name: "docs", name: "docs",
route: "docs.index", route: "docs.index",

View File

@ -10,10 +10,12 @@ import docsFixtures from "../fixtures/docs";
import { cloneJSON } from "discourse-common/lib/object"; import { cloneJSON } from "discourse-common/lib/object";
acceptance("Docs - Sidebar with docs disabled", function (needs) { acceptance("Docs - Sidebar with docs disabled", function (needs) {
needs.user({ experimental_sidebar_enabled: true }); needs.user();
needs.settings({ needs.settings({
docs_enabled: false, docs_enabled: false,
enable_experimental_sidebar_hamburger: true,
enable_sidebar: true,
}); });
test("docs sidebar link is hidden", async function (assert) { test("docs sidebar link is hidden", async function (assert) {
@ -27,9 +29,12 @@ acceptance("Docs - Sidebar with docs disabled", function (needs) {
}); });
acceptance("Docs - Sidebar with docs enabled", function (needs) { acceptance("Docs - Sidebar with docs enabled", function (needs) {
needs.user({ experimental_sidebar_enabled: true }); needs.user();
needs.settings({ needs.settings({
docs_enabled: true, docs_enabled: true,
enable_experimental_sidebar_hamburger: true,
enable_sidebar: true,
}); });
needs.pretender((server, helper) => { needs.pretender((server, helper) => {