From aed37c19c768be5853b0838b5b954980b59652b7 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 5 Jun 2021 12:18:59 +0530 Subject: [PATCH] More tests --- cypress/integration/loadSite.spec.ts | 13 +++++++++++++ cypress/snapshots.js | 3 +++ 2 files changed, 16 insertions(+) diff --git a/cypress/integration/loadSite.spec.ts b/cypress/integration/loadSite.spec.ts index 1920ba2d..b1de3c0a 100644 --- a/cypress/integration/loadSite.spec.ts +++ b/cypress/integration/loadSite.spec.ts @@ -32,7 +32,20 @@ describe('Site Loads', () => { it('should load diagram from gist', () => { cy.visit(`/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a`); + cy.contains('Go shopping!!'); + cy.contains('Revisions'); + cy.contains('sidharthv96 v8f8f1e2'); + cy.contains('sidharthv96 v7851e19'); + cy.getLocalStorage('codeStore').snapshot(); + }); + + it('should load diagram from gist revision', () => { + cy.visit( + '/edit?gist=https://gist.github.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/ec9b4ab0e41e4ff6287326cd3cb47affd7851e19' + ); cy.contains('Party'); + cy.contains('Revisions'); + cy.contains('sidharthv96 v7851e19'); cy.getLocalStorage('codeStore').snapshot(); }); diff --git a/cypress/snapshots.js b/cypress/snapshots.js index 39090b23..9d2f8a33 100644 --- a/cypress/snapshots.js +++ b/cypress/snapshots.js @@ -19,6 +19,9 @@ module.exports = { }, "should load diagram from raw files": { "1": "{\"code\":\"graph TD\\n A[Party] -->|Get money| B(Go shopping!!)\\n \",\"mermaid\":\"{\\n \\\"theme\\\": \\\"forest\\\",\\n \\\"test\\\": \\\"hello world\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":true,\"loader\":{\"type\":\"files\",\"config\":{\"codeURL\":\"https://gist.githubusercontent.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/raw/4eb03887e6a41397e80bdcdbf94017c498f8f1e2/code.mmd\",\"configURL\":\"https://gist.githubusercontent.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/raw/4eb03887e6a41397e80bdcdbf94017c498f8f1e2/config.json\"}}}" + }, + "should load diagram from gist revision": { + "1": "{\"code\":\"graph TD\\n A[Party] -->|Get money| B(Go shopping)\\n \",\"mermaid\":\"{\\n \\\"theme\\\": \\\"forest\\\",\\n \\\"test\\\": \\\"hello\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":true}" } }, "__version": "7.4.0"