Skip to content

Commit 734463d

Browse files
committed
test(docs-plugin): add tests for directory routes
Signed-off-by: Ryan Bower <rbower@qti.qualcomm.com>
1 parent a7a622a commit 734463d

11 files changed

Lines changed: 540 additions & 0 deletions

File tree

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
[
2+
{
3+
"depth": 1,
4+
"expanded": false,
5+
"id": "/",
6+
"order": 1,
7+
"pathname": "/",
8+
"pathSegments": [],
9+
"title": "Introduction"
10+
},
11+
{
12+
"depth": 1,
13+
"expanded": true,
14+
"id": "/guide",
15+
"items": [
16+
{
17+
"depth": 2,
18+
"expanded": false,
19+
"id": "/guide/markdown",
20+
"items": [],
21+
"order": 1,
22+
"pathname": "/guide/markdown",
23+
"pathSegments": [
24+
"guide",
25+
"markdown"
26+
],
27+
"title": "Markdown"
28+
},
29+
{
30+
"depth": 2,
31+
"expanded": false,
32+
"id": "/guide/page-setup",
33+
"items": [],
34+
"order": 2,
35+
"pathname": "/guide/page-setup",
36+
"pathSegments": [
37+
"guide",
38+
"page-setup"
39+
],
40+
"title": "Page Setup"
41+
},
42+
{
43+
"depth": 2,
44+
"expanded": true,
45+
"id": "/guide/advanced",
46+
"items": [
47+
{
48+
"depth": 3,
49+
"expanded": false,
50+
"id": "/guide/advanced/deep-topic",
51+
"items": [],
52+
"order": 1,
53+
"pathname": "/guide/advanced/deep-topic",
54+
"pathSegments": [
55+
"guide",
56+
"advanced",
57+
"deep-topic"
58+
],
59+
"title": "Deep Topic"
60+
}
61+
],
62+
"order": 3,
63+
"pathSegments": [
64+
"guide",
65+
"advanced"
66+
],
67+
"title": "Advanced"
68+
},
69+
{
70+
"depth": 2,
71+
"expanded": false,
72+
"id": "/guide/redirect",
73+
"items": [],
74+
"order": 4,
75+
"pathname": "/guide/redirect",
76+
"pathSegments": [
77+
"guide",
78+
"redirect"
79+
],
80+
"title": "Redirect"
81+
}
82+
],
83+
"order": 2,
84+
"pathSegments": [
85+
"guide"
86+
],
87+
"title": "Guide"
88+
},
89+
{
90+
"depth": 1,
91+
"expanded": false,
92+
"id": "/api",
93+
"items": [
94+
{
95+
"depth": 2,
96+
"expanded": false,
97+
"id": "/api/page-frontmatter",
98+
"items": [],
99+
"order": 1,
100+
"pathname": "/api/page-frontmatter",
101+
"pathSegments": [
102+
"api",
103+
"page-frontmatter"
104+
],
105+
"title": "Page Frontmatter"
106+
}
107+
],
108+
"order": 3,
109+
"pathSegments": [
110+
"api"
111+
],
112+
"title": "API"
113+
}
114+
]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"/": {
3+
"categories": [
4+
"Introduction"
5+
],
6+
"data": {
7+
"id": "_index",
8+
"title": "Introduction"
9+
},
10+
"id": "/routes/_index.mdx",
11+
"pathname": "/",
12+
"pathSegments": [],
13+
"title": "Introduction"
14+
},
15+
"/guide/page-setup": {
16+
"categories": [
17+
"Guide",
18+
"Page Setup"
19+
],
20+
"data": {
21+
"title": "Page Setup"
22+
},
23+
"id": "/routes/guide/page-setup.mdx",
24+
"pathname": "/guide/page-setup",
25+
"pathSegments": [
26+
"guide",
27+
"page-setup"
28+
],
29+
"title": "Page Setup",
30+
"toc": [
31+
{
32+
"headingLevel": 2,
33+
"id": "nested-folders",
34+
"tagName": "h2",
35+
"textContent": "Nested Folders"
36+
}
37+
]
38+
},
39+
"/guide/markdown": {
40+
"categories": [
41+
"Guide",
42+
"Markdown"
43+
],
44+
"data": {
45+
"title": "Markdown",
46+
"description": "Author Markdown content in directory routes."
47+
},
48+
"description": "Author Markdown content in directory routes.",
49+
"id": "/routes/guide/markdown.mdx",
50+
"pathname": "/guide/markdown",
51+
"pathSegments": [
52+
"guide",
53+
"markdown"
54+
],
55+
"title": "Markdown",
56+
"toc": [
57+
{
58+
"headingLevel": 2,
59+
"id": "frontmatter",
60+
"tagName": "h2",
61+
"textContent": "Frontmatter"
62+
}
63+
]
64+
},
65+
"/guide/advanced/deep-topic": {
66+
"categories": [
67+
"Guide",
68+
"Advanced",
69+
"Deep Topic"
70+
],
71+
"data": {
72+
"title": "Deep Topic"
73+
},
74+
"id": "/routes/guide/advanced/deep-topic.mdx",
75+
"pathname": "/guide/advanced/deep-topic",
76+
"pathSegments": [
77+
"guide",
78+
"advanced",
79+
"deep-topic"
80+
],
81+
"title": "Deep Topic"
82+
},
83+
"/api/page-frontmatter": {
84+
"categories": [
85+
"API",
86+
"Page Frontmatter"
87+
],
88+
"data": {
89+
"title": "Page Frontmatter"
90+
},
91+
"id": "/routes/api/page-frontmatter.mdx",
92+
"pathname": "/api/page-frontmatter",
93+
"pathSegments": [
94+
"api",
95+
"page-frontmatter"
96+
],
97+
"title": "Page Frontmatter"
98+
},
99+
"/guide/redirect": {
100+
"categories": [
101+
"Guide",
102+
"Redirect"
103+
],
104+
"data": {},
105+
"id": "/routes/guide/redirect.tsx",
106+
"pathname": "/guide/redirect",
107+
"pathSegments": [
108+
"guide",
109+
"redirect"
110+
],
111+
"title": "Redirect"
112+
}
113+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
[
2+
{
3+
"categories": [
4+
"Introduction"
5+
],
6+
"data": {
7+
"id": "_index",
8+
"title": "Introduction"
9+
},
10+
"id": "/routes/_index.mdx-0",
11+
"pathname": "/",
12+
"pathSegments": [],
13+
"title": "Introduction",
14+
"content": "Directory routes use plain folders for nested URLs.",
15+
"heading": "Introduction",
16+
"headingLevel": 1,
17+
"href": "/"
18+
},
19+
{
20+
"categories": [
21+
"Guide",
22+
"Page Setup"
23+
],
24+
"data": {
25+
"title": "Page Setup"
26+
},
27+
"id": "/routes/guide/page-setup.mdx-0",
28+
"pathname": "/guide/page-setup",
29+
"pathSegments": [
30+
"guide",
31+
"page-setup"
32+
],
33+
"title": "Page Setup",
34+
"content": "Create pages by adding files under the routes directory.",
35+
"heading": "Page Setup",
36+
"headingLevel": 1,
37+
"href": "/guide/page-setup"
38+
},
39+
{
40+
"categories": [
41+
"Guide",
42+
"Page Setup"
43+
],
44+
"data": {
45+
"title": "Page Setup"
46+
},
47+
"id": "/routes/guide/page-setup.mdx-1",
48+
"pathname": "/guide/page-setup",
49+
"pathSegments": [
50+
"guide",
51+
"page-setup"
52+
],
53+
"title": "Page Setup",
54+
"content": "Plain folders become URL segments in directory mode.",
55+
"heading": "Nested Folders",
56+
"headingLevel": 2,
57+
"href": "/guide/page-setup#nested-folders"
58+
},
59+
{
60+
"categories": [
61+
"Guide",
62+
"Markdown"
63+
],
64+
"data": {
65+
"title": "Markdown",
66+
"description": "Author Markdown content in directory routes."
67+
},
68+
"description": "Author Markdown content in directory routes.",
69+
"id": "/routes/guide/markdown.mdx-0",
70+
"pathname": "/guide/markdown",
71+
"pathSegments": [
72+
"guide",
73+
"markdown"
74+
],
75+
"title": "Markdown",
76+
"content": "Markdown pages can live in nested folders without a trailing plus sign.",
77+
"heading": "Markdown",
78+
"headingLevel": 1,
79+
"href": "/guide/markdown"
80+
},
81+
{
82+
"categories": [
83+
"Guide",
84+
"Markdown"
85+
],
86+
"data": {
87+
"title": "Markdown",
88+
"description": "Author Markdown content in directory routes."
89+
},
90+
"description": "Author Markdown content in directory routes.",
91+
"id": "/routes/guide/markdown.mdx-1",
92+
"pathname": "/guide/markdown",
93+
"pathSegments": [
94+
"guide",
95+
"markdown"
96+
],
97+
"title": "Markdown",
98+
"content": "Frontmatter still supplies page metadata.",
99+
"heading": "Frontmatter",
100+
"headingLevel": 2,
101+
"href": "/guide/markdown#frontmatter"
102+
},
103+
{
104+
"categories": [
105+
"Guide",
106+
"Advanced",
107+
"Deep Topic"
108+
],
109+
"data": {
110+
"title": "Deep Topic"
111+
},
112+
"id": "/routes/guide/advanced/deep-topic.mdx-0",
113+
"pathname": "/guide/advanced/deep-topic",
114+
"pathSegments": [
115+
"guide",
116+
"advanced",
117+
"deep-topic"
118+
],
119+
"title": "Deep Topic",
120+
"content": "Multiple nested folders resolve to multiple URL segments.",
121+
"heading": "Deep Topic",
122+
"headingLevel": 1,
123+
"href": "/guide/advanced/deep-topic"
124+
},
125+
{
126+
"categories": [
127+
"API",
128+
"Page Frontmatter"
129+
],
130+
"data": {
131+
"title": "Page Frontmatter"
132+
},
133+
"id": "/routes/api/page-frontmatter.mdx-0",
134+
"pathname": "/api/page-frontmatter",
135+
"pathSegments": [
136+
"api",
137+
"page-frontmatter"
138+
],
139+
"title": "Page Frontmatter",
140+
"content": "API pages can also be organized with regular folders.",
141+
"heading": "Page Frontmatter",
142+
"headingLevel": 1,
143+
"href": "/api/page-frontmatter"
144+
}
145+
]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
id: _index
3+
title: Introduction
4+
---
5+
6+
# {frontmatter.title}
7+
8+
Directory routes use plain folders for nested URLs.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Page Frontmatter
3+
---
4+
5+
# {frontmatter.title}
6+
7+
API pages can also be organized with regular folders.

0 commit comments

Comments
 (0)