From 735aceb37a3a5907c97e9de0ca243fa6ae1b31a4 Mon Sep 17 00:00:00 2001
From: Sidharth Vinod
Date: Sun, 19 Feb 2023 14:03:11 +0530
Subject: [PATCH] Fix E2E Tests
---
.vite/server.ts | 10 +---
cypress/platform/bundle-test.js | 16 ++----
cypress/platform/class.html | 4 +-
cypress/platform/click_security_loose.html | 4 +-
cypress/platform/click_security_other.html | 4 +-
cypress/platform/click_security_sandbox.html | 4 +-
cypress/platform/click_security_strict.html | 4 +-
cypress/platform/css1.html | 4 +-
cypress/platform/current2.html | 4 +-
cypress/platform/e2e.html | 38 +------------
cypress/platform/flow.html | 4 +-
cypress/platform/ghsa1.html | 14 ++---
cypress/platform/ghsa2.html | 6 +-
cypress/platform/ghsa3.html | 16 +++---
cypress/platform/git-graph.html | 4 +-
cypress/platform/gitgraph.html | 4 +-
cypress/platform/gitgraph2.html | 4 +-
cypress/platform/huge.html | 4 +-
cypress/platform/info.html | 4 +-
cypress/platform/interaction.html | 4 +-
cypress/platform/per.html | 2 +-
cypress/platform/regression/issue-1874.html | 18 +++---
cypress/platform/render-after-error.html | 15 +++--
cypress/platform/rerender.html | 16 +++---
cypress/platform/showcase_base.html | 4 +-
cypress/platform/showcase_base_dark.html | 4 +-
cypress/platform/showcase_dark.html | 4 +-
cypress/platform/showcase_default.html | 4 +-
cypress/platform/showcase_forest.html | 4 +-
cypress/platform/showcase_neutral.html | 4 +-
cypress/platform/sidv.html | 6 --
cypress/platform/subgraph.html | 4 +-
cypress/platform/theme-directives.html | 4 +-
cypress/platform/user-journey.html | 4 +-
cypress/platform/vertices.html | 4 +-
cypress/platform/viewer.js | 29 +++-------
cypress/platform/xss.html | 4 +-
cypress/platform/xss10.html | 11 ++--
cypress/platform/xss11.html | 11 ++--
cypress/platform/xss12.html | 11 ++--
cypress/platform/xss13.html | 11 ++--
cypress/platform/xss14.html | 11 ++--
cypress/platform/xss15.html | 11 ++--
cypress/platform/xss16.html | 11 ++--
cypress/platform/xss17.html | 11 ++--
cypress/platform/xss18.html | 11 ++--
cypress/platform/xss19.html | 11 ++--
cypress/platform/xss2.html | 6 +-
cypress/platform/xss20.html | 10 ++--
cypress/platform/xss21.html | 12 ++--
cypress/platform/xss22.html | 4 +-
cypress/platform/xss3.html | 4 +-
cypress/platform/xss4.html | 9 ++-
cypress/platform/xss5.html | 11 ++--
cypress/platform/xss6.html | 11 ++--
cypress/platform/xss7.html | 11 ++--
cypress/platform/xss8.html | 11 ++--
cypress/platform/xss9.html | 11 ++--
demos/c4context.html | 22 +++----
demos/classchart.html | 4 +-
demos/dataflowchart.html | 4 +-
demos/er.html | 2 +-
demos/flowchart.html | 4 +-
demos/gantt.html | 4 +-
demos/git.html | 4 +-
demos/journey.html | 4 +-
demos/requirements.html | 4 +-
demos/sequence.html | 4 +-
demos/state.html | 4 +-
demos/timeline.html | 4 +-
docs/config/usage.md | 4 +-
package.json | 4 +-
packages/mermaid/src/docs/config/usage.md | 4 +-
pnpm-lock.yaml | 60 +++++++++++++++++++-
74 files changed, 298 insertions(+), 334 deletions(-)
diff --git a/.vite/server.ts b/.vite/server.ts
index 0f1fef91d..6f8959348 100644
--- a/.vite/server.ts
+++ b/.vite/server.ts
@@ -1,13 +1,7 @@
-import express, { NextFunction, Request, Response } from 'express';
+import express from 'express';
+import cors from 'cors';
import { createServer as createViteServer } from 'vite';
-const cors = (req: Request, res: Response, next: NextFunction) => {
- res.header('Access-Control-Allow-Origin', '*');
- res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
- res.header('Access-Control-Allow-Headers', 'Content-Type');
-
- next();
-};
async function createServer() {
const app = express();
diff --git a/cypress/platform/bundle-test.js b/cypress/platform/bundle-test.js
index a991918c4..edd3dfbc4 100644
--- a/cypress/platform/bundle-test.js
+++ b/cypress/platform/bundle-test.js
@@ -49,13 +49,9 @@ mermaid.initialize({
],
},
});
-mermaid.render(
- 'the-id-of-the-svg',
- code,
- (svg) => {
- console.log(svg);
- const elem = document.querySelector('#graph-to-be');
- elem.innerHTML = svg;
- }
- // ,document.querySelector('#tmp')
-);
+void (async () => {
+ const { svg } = await mermaid.render('the-id-of-the-svg', code);
+ console.log(svg);
+ const elem = document.querySelector('#graph-to-be');
+ elem.innerHTML = svg;
+})();
diff --git a/cypress/platform/class.html b/cypress/platform/class.html
index 1d72c34a5..052dd18b9 100644
--- a/cypress/platform/class.html
+++ b/cypress/platform/class.html
@@ -113,8 +113,8 @@ classE o-- classF : aggregation
callback Shape "callbackFunction" "This is a tooltip for a callback"
-
-
+
-
-
-