fix: reject alternate sidebar entries
Build and publish Corp v1 Board portal / build (pull_request) Successful in 35s
Build and publish Corp v1 Board portal / build (pull_request) Successful in 35s
This commit is contained in:
@@ -67,14 +67,23 @@ for (const route of ['/', 'architecture-high-level', 'projects', 'teams', 'membe
|
|||||||
}
|
}
|
||||||
|
|
||||||
const architectureSidebar = read('sidebars/architecture-high-level.ts');
|
const architectureSidebar = read('sidebars/architecture-high-level.ts');
|
||||||
const architectureEntries = [...architectureSidebar.matchAll(/\{type:\s*'doc',\s*id:\s*'([^']+)',\s*label:\s*'([^']+)'\}/g)]
|
const expectedArchitectureSidebar = `import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||||
.map((match) => ({id: match[1], label: match[2]}));
|
|
||||||
assert.deepEqual(architectureEntries, [
|
const sidebars: SidebarsConfig = {
|
||||||
{id: 'context', label: 'Context'},
|
architectureHighLevelSidebar: [
|
||||||
{id: 'overview', label: 'Overview'},
|
{type: 'doc', id: 'context', label: 'Context'},
|
||||||
{id: 'overview-channels', label: 'Overview Channels'},
|
{type: 'doc', id: 'overview', label: 'Overview'},
|
||||||
{id: 'overview-repositories', label: 'Overview Repositories'},
|
{type: 'doc', id: 'overview-channels', label: 'Overview Channels'},
|
||||||
], 'Architecture High Level sidebar must contain exactly the four requested documents in order');
|
{type: 'doc', id: 'overview-repositories', label: 'Overview Repositories'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default sidebars;`;
|
||||||
|
assert.equal(
|
||||||
|
architectureSidebar.trim(),
|
||||||
|
expectedArchitectureSidebar,
|
||||||
|
'Architecture High Level sidebar must contain exactly the four requested documents in order',
|
||||||
|
);
|
||||||
const architecturePages = {
|
const architecturePages = {
|
||||||
context: read('docs/architecture-high-level/context.mdx'),
|
context: read('docs/architecture-high-level/context.mdx'),
|
||||||
overview: read('docs/architecture-high-level/overview.mdx'),
|
overview: read('docs/architecture-high-level/overview.mdx'),
|
||||||
|
|||||||
Reference in New Issue
Block a user