diff --git a/cypress/integration/docMap.spec.ts b/cypress/integration/docMap.spec.ts new file mode 100755 index 00000000..904e165d --- /dev/null +++ b/cypress/integration/docMap.spec.ts @@ -0,0 +1,36 @@ +describe('Editor docs tests', () => { + beforeEach(() => { + cy.on('uncaught:exception', () => { + return false; + }); + cy.clearLocalStorage(); + cy.visit('/edit'); + cy.contains('Sample Diagrams').click(); + }); + + it('Test default loading', () => { + cy.get(`[data-cy=docs][href^="https://mermaid-js.github.io/mermaid"]`).should('exist'); + }); + + it('Test to see if the correct URL loads when changing from one diagram to other', () => { + cy.contains('Flow Chart').click(); + cy.get(`[data-cy=docs][href$="/#/flowchart"]`).should('exist'); + + cy.contains('Config').click(); + cy.get(`[data-cy=docs][href$="/#/flowchart?id=configuration"]`).should('exist'); + + cy.contains('Sequence Diagram').click(); + cy.get(`[data-cy=docs][href$="/#/sequenceDiagram?id=configuration"]`).should('exist'); + + cy.contains('Code').click(); + cy.get(`[data-cy=docs][href$="/#/sequenceDiagram"]`).should('exist'); + }); + + it("Test to check URLs for a case where config URL doesn't exist", () => { + cy.contains('State Diagram').click(); + cy.get(`[data-cy=docs][href$="/#/stateDiagram"]`).should('exist'); + + cy.contains('Config').click(); + cy.get(`[data-cy=docs][href$="/#/stateDiagram"]`).should('exist'); + }); +}); diff --git a/src/app.html b/src/app.html index 80e2a820..a958d36c 100644 --- a/src/app.html +++ b/src/app.html @@ -11,8 +11,8 @@ - - + + diff --git a/src/lib/components/card/tabs.svelte b/src/lib/components/card/tabs.svelte index 18382abd..5fe726b9 100644 --- a/src/lib/components/card/tabs.svelte +++ b/src/lib/components/card/tabs.svelte @@ -26,7 +26,7 @@