mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2026-11-04 08:59:08 +00:00
Adds docs paths for agentflow, cynefin, eventmodeling, ishikawa, radar, the four railroad variants, swimlane, treeView, usecase, venn and wardley, taken from packages/mermaid/src/docs/syntax in the mermaid repo and checked against the published pages (config anchors included). A new test parses every @mermaid-js/examples sample and fails when a detected diagram type has no docs entry, so the next new type is caught on the dependency bump instead of silently linking to the docs home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
2.0 KiB
TypeScript
51 lines
2.0 KiB
TypeScript
import { test } from './test';
|
|
|
|
test.describe('Editor docs tests', () => {
|
|
test.beforeEach(async ({ editPage }) => {
|
|
await editPage.toggleSampleDiagrams();
|
|
});
|
|
|
|
test('Test default loading', async ({ editPage }) => {
|
|
await editPage.checkDocURL(/mermaid\.js\.org\//);
|
|
});
|
|
|
|
test('Test to see if the correct URL loads when changing from one diagram to other', async ({
|
|
editPage
|
|
}) => {
|
|
await editPage.loadSampleDiagram('Flowchart');
|
|
await editPage.checkDocURL(/syntax\/flowchart\.html/);
|
|
await editPage.setEditorMode('Config');
|
|
await editPage.checkDocURL(/syntax\/flowchart\.html#configuration/);
|
|
await editPage.setEditorMode('Code');
|
|
await editPage.checkDocURL(/syntax\/flowchart\.html/);
|
|
|
|
await editPage.loadSampleDiagram('Sequence');
|
|
await editPage.checkDocURL(/syntax\/sequenceDiagram\.html/);
|
|
await editPage.setEditorMode('Config');
|
|
await editPage.checkDocURL(/syntax\/sequenceDiagram\.html#configuration/);
|
|
await editPage.setEditorMode('Code');
|
|
await editPage.checkDocURL(/syntax\/sequenceDiagram\.html/);
|
|
|
|
await editPage.loadSampleDiagram('Class');
|
|
await editPage.checkDocURL(/syntax\/classDiagram\.html/);
|
|
await editPage.setEditorMode('Config');
|
|
await editPage.checkDocURL(/syntax\/classDiagram\.html#configuration/);
|
|
await editPage.setEditorMode('Code');
|
|
|
|
await editPage.loadSampleDiagram('Radar');
|
|
await editPage.checkDocURL(/syntax\/radar\.html/);
|
|
await editPage.setEditorMode('Config');
|
|
await editPage.checkDocURL(/syntax\/radar\.html#configuration/);
|
|
await editPage.setEditorMode('Code');
|
|
});
|
|
|
|
test("Test to check URLs for a case where config URL doesn't exist", async ({ editPage }) => {
|
|
await editPage.loadSampleDiagram('State');
|
|
await editPage.checkDocURL(/syntax\/stateDiagram\.html/);
|
|
await editPage.setEditorMode('Config');
|
|
await editPage.checkDocURL(/syntax\/stateDiagram\.html/);
|
|
await editPage.setEditorMode('Code');
|
|
await editPage.checkDocURL(/syntax\/stateDiagram\.html/);
|
|
});
|
|
});
|