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 architectureEntries = [...architectureSidebar.matchAll(/\{type:\s*'doc',\s*id:\s*'([^']+)',\s*label:\s*'([^']+)'\}/g)]
|
||||
.map((match) => ({id: match[1], label: match[2]}));
|
||||
assert.deepEqual(architectureEntries, [
|
||||
{id: 'context', label: 'Context'},
|
||||
{id: 'overview', label: 'Overview'},
|
||||
{id: 'overview-channels', label: 'Overview Channels'},
|
||||
{id: 'overview-repositories', label: 'Overview Repositories'},
|
||||
], 'Architecture High Level sidebar must contain exactly the four requested documents in order');
|
||||
const expectedArchitectureSidebar = `import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
const sidebars: SidebarsConfig = {
|
||||
architectureHighLevelSidebar: [
|
||||
{type: 'doc', id: 'context', label: 'Context'},
|
||||
{type: 'doc', id: 'overview', label: 'Overview'},
|
||||
{type: 'doc', id: 'overview-channels', label: 'Overview Channels'},
|
||||
{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 = {
|
||||
context: read('docs/architecture-high-level/context.mdx'),
|
||||
overview: read('docs/architecture-high-level/overview.mdx'),
|
||||
|
||||
Reference in New Issue
Block a user