From c9329425faef7d90135471e02aa2d083599bdb94 Mon Sep 17 00:00:00 2001 From: Jess Date: Sun, 30 Jan 2022 05:16:45 -0500 Subject: fix: removing toc to fix the docs html (#341) Co-authored-by: Shinigami --- .gitignore | 3 +++ cypress.json | 1 + cypress/e2e/smoke.cy.ts | 25 ++++++++++++++++++++----- scripts/apidoc.ts | 2 -- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8acf826f..414655ad 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,6 @@ REVISION .yarn/ package-lock.json yarn.lock + +cypress/screenshots +cypress/videos diff --git a/cypress.json b/cypress.json index fd984a2b..011099fd 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,7 @@ { "video": false, "e2e": { + "chromeWebSecurity": false, "baseUrl": "http://localhost:5000", "integrationFolder": "cypress/e2e", "testFiles": "**/*.cy.*", diff --git a/cypress/e2e/smoke.cy.ts b/cypress/e2e/smoke.cy.ts index 6b3bc06b..eb3cf1fb 100644 --- a/cypress/e2e/smoke.cy.ts +++ b/cypress/e2e/smoke.cy.ts @@ -1,11 +1,26 @@ describe('Smoke Test', () => { - it('compiles the guide page', () => { + beforeEach(() => { cy.visit('/guide/'); + cy.get('a[href="/api/animal.html"]').as('firstSectionLink'); + }); + + it('compiles the guide page', () => { cy.contains('Getting Started'); }); - // it('compiles the playground page', () => { - // cy.visit('/playground/'); - // cy.contains('Playground under construction'); - // }); + it('renders this last code example in the code', () => { + // Click on any section in the sidebar + cy.get('@firstSectionLink') + .click() + // Make sure the number of code examples is the same between reloads + .get('.container pre code') + .then(($codeBlocks) => { + // Trigger a reload + cy.reload() + // Give the runtime a chance to update/fail + .wait(500) + .get('.container pre code') + .should('have.length', $codeBlocks.length); + }); + }); }); diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts index 2d180095..3d972c95 100644 --- a/scripts/apidoc.ts +++ b/scripts/apidoc.ts @@ -102,8 +102,6 @@ async function build(): Promise { - [[toc]] - ::: v-pre ${toBlock(module.comment)} -- cgit v1.2.3