Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions content/navigation-bar/docs-navigation-bar-zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@
}
]
},
{
"title": "迁移",
"items": [
{
"slug": "content/docs-zh/guides/converting-wordpress-to-tina.mdx",
"title": "WordPress",
"_template": "item"
},
{
"slug": "content/docs-zh/guides/converting-gatsby-to-tina.mdx",
"title": "Gatsby",
"_template": "item"
}
]
},
{
"title": "配置TinaCMS",
"items": [
Expand Down Expand Up @@ -824,22 +839,6 @@
"title": "概述",
"_template": "item"
},
{
"slug": "content/docs-zh/guides/converting-wordpress-to-tina.mdx",
"title": "从WordPress迁移",
"_template": "item"
},
{
"title": "Gatsby",
"items": [
{
"slug": "content/docs-zh/guides/converting-gatsby-to-tina.mdx",
"title": "将现有Gatsby博客迁移到TinaCMS",
"_template": "item"
}
],
"_template": "items"
},
{
"title": "NextJS",
"items": [
Expand Down
31 changes: 15 additions & 16 deletions content/navigation-bar/docs-navigation-bar.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@
}
]
},
{
"title": "Migration",
"items": [
{
"slug": "content/docs/guides/converting-wordpress-to-tina.mdx",
"title": "WordPress",
"_template": "item"
},
{
"slug": "content/docs/guides/converting-gatsby-to-tina.mdx",
"title": "Gatsby",
"_template": "item"
}
]
},
{
"title": "Configuring TinaCMS",
"items": [
Expand Down Expand Up @@ -974,22 +989,6 @@
"title": "Overview",
"_template": "item"
},
{
"slug": "content/docs/guides/converting-wordpress-to-tina.mdx",
"title": "Migrating From WordPress",
"_template": "item"
},
{
"title": "Gatsby",
"items": [
{
"slug": "content/docs/guides/converting-gatsby-to-tina.mdx",
"title": "Migrating an existing Gatsby blog to TinaCMS",
"_template": "item"
}
],
"_template": "items"
},
{
"title": "NextJS",
"items": [
Expand Down
22 changes: 11 additions & 11 deletions tests/e2e/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { expect, test } from "@playwright/test";
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "/docs";

// content/navigation-bar/docs-navigation-bar.json, Docs tab, supermenuGroup order:
// 0 Introduction, 1 Configuring TinaCMS, 2 Querying Content
// 0 Introduction, 1 Migration, 2 Configuring TinaCMS, 3 Querying Content
const FIRST_GROUP = "nav-group-0";
const SECOND_GROUP = "nav-group-1";
const UNRELATED_GROUP = "nav-group-2";
const CONFIG_GROUP = "nav-group-2";
const UNRELATED_GROUP = "nav-group-3";

const FIRST_GROUP_ITEM = `a[href="${basePath}/setup-overview"]`;
// First slug under the second group (Configuring TinaCMS).
// First slug under Configuring TinaCMS.
const NESTED_PAGE = "/tina-folder/overview";
const SECOND_GROUP_ITEM = `a[href="${basePath}/reference/config"]`;
const CONFIG_GROUP_ITEM = `a[href="${basePath}/reference/config"]`;
const UNRELATED_GROUP_ITEM = `a[href="${basePath}/features/data-fetching"]`;

test.describe("Sidebar default expand state", () => {
Expand All @@ -31,25 +31,25 @@ test.describe("Sidebar default expand state", () => {
await page.goto(`${basePath}/`);

const firstGroup = page.getByTestId(FIRST_GROUP);
const secondGroup = page.getByTestId(SECOND_GROUP);
const configGroup = page.getByTestId(CONFIG_GROUP);
await expect(firstGroup).toHaveCount(1);
await expect(secondGroup).toHaveCount(1);
await expect(configGroup).toHaveCount(1);

await expect(firstGroup.locator(FIRST_GROUP_ITEM)).toBeVisible();
await expect(secondGroup.locator(SECOND_GROUP_ITEM)).not.toBeVisible();
await expect(configGroup.locator(CONFIG_GROUP_ITEM)).not.toBeVisible();
});

test("visiting a nested page opens its ancestor group and leaves unrelated groups closed", async ({
page,
}) => {
await page.goto(`${basePath}${NESTED_PAGE}`);

const secondGroup = page.getByTestId(SECOND_GROUP);
const configGroup = page.getByTestId(CONFIG_GROUP);
const unrelatedGroup = page.getByTestId(UNRELATED_GROUP);
await expect(secondGroup).toHaveCount(1);
await expect(configGroup).toHaveCount(1);
await expect(unrelatedGroup).toHaveCount(1);

await expect(secondGroup.locator(SECOND_GROUP_ITEM)).toBeVisible();
await expect(configGroup.locator(CONFIG_GROUP_ITEM)).toBeVisible();
await expect(
unrelatedGroup.locator(UNRELATED_GROUP_ITEM)
).not.toBeVisible();
Expand Down
Loading