From 5efa473e2d6d8b692bfe517a78fa59599a92d8bf Mon Sep 17 00:00:00 2001 From: HeroProtagonist Date: Sat, 22 Jan 2022 23:49:52 -0500 Subject: [PATCH 1/3] bump monaco-mermaid --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 968bf99fab..feeaeaad4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3156,9 +3156,9 @@ monaco-editor@^0.31.1: integrity sha512-FYPwxGZAeP6mRRyrr5XTGHD9gRXVjy7GUzF4IPChnyt3fS5WrNxIkS8DNujWf6EQy0Zlzpxw8oTVE+mWI2/D1Q== monaco-mermaid@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/monaco-mermaid/-/monaco-mermaid-1.0.2.tgz#a96d2c5dfbf9fc591cb7c61dff40a3d188021337" - integrity sha512-H0waK3QyTklsE3hKW4bvDFt+8Wcfghszi125wQVS89gzlHZMxZh5w1RqQe85d4FSmjwc3t1o71pCkyEYiZJiXg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/monaco-mermaid/-/monaco-mermaid-1.0.3.tgz#807bf5a0635723684029646b716a2ba97dd6a175" + integrity sha512-SOtoCXxfUXCh8j09OhgambkQ8eqbifaK2YYt2lAo5YXIk/iRXdprvBVhLOJNx1gTMtRNINixALGaTy5StYfiqw== mri@^1.1.0: version "1.1.6" From 534b9fb08bdbf228fa59c7e342f0b30473abc9e1 Mon Sep 17 00:00:00 2001 From: HeroProtagonist Date: Sat, 22 Jan 2022 23:50:22 -0500 Subject: [PATCH 2/3] add spec around commenting code --- cypress/integration/diagramUpdate.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cypress/integration/diagramUpdate.spec.ts b/cypress/integration/diagramUpdate.spec.ts index 0edcf569e9..640e4e4e9d 100644 --- a/cypress/integration/diagramUpdate.spec.ts +++ b/cypress/integration/diagramUpdate.spec.ts @@ -30,4 +30,12 @@ describe('Auto sync tests', () => { cy.get('#view').should('not.have.class', 'outOfSync'); cy.getLocalStorage('codeStore').snapshot(); }); + + it('supports commenting code out/in', () => { + cy.get('#editor').type('{uparrow} {cmd}/'); + cy.get('#view').contains('Car').should('not.exist'); + + cy.get('#editor').type('{uparrow} {cmd}/'); + cy.get('#view').contains('Car').should('exist'); + }); }); From 0175955f9b23d98ffcff5b2aef036cbe1decca89 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 23 Jan 2022 11:06:11 +0530 Subject: [PATCH 3/3] fix: Command --- cypress/integration/diagramUpdate.spec.ts | 6 ++++-- cypress/snapshots.js | 2 +- package.json | 2 +- yarn.lock | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cypress/integration/diagramUpdate.spec.ts b/cypress/integration/diagramUpdate.spec.ts index 640e4e4e9d..b0075aa2f9 100644 --- a/cypress/integration/diagramUpdate.spec.ts +++ b/cypress/integration/diagramUpdate.spec.ts @@ -32,10 +32,12 @@ describe('Auto sync tests', () => { }); it('supports commenting code out/in', () => { - cy.get('#editor').type('{uparrow} {cmd}/'); + const cmd = Cypress.platform === 'darwin' ? 'meta' : 'ctrl'; + + cy.get('#editor').type(`{uparrow}{${cmd}}/`); cy.get('#view').contains('Car').should('not.exist'); - cy.get('#editor').type('{uparrow} {cmd}/'); + cy.get('#editor').type(`{uparrow}{${cmd}}/`); cy.get('#view').contains('Car').should('exist'); }); }); diff --git a/cypress/snapshots.js b/cypress/snapshots.js index d023001fe4..95cbdd6ee8 100644 --- a/cypress/snapshots.js +++ b/cypress/snapshots.js @@ -16,7 +16,7 @@ module.exports = { "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\"}}}" } }, - "__version": "9.2.0", + "__version": "9.3.1", "Auto sync tests": { "should dim diagram when code is edited": { "1": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Test\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":false,\"updateDiagram\":false}" diff --git a/package.json b/package.json index 79ab0ce8ec..a38aeac5eb 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "mermaid": "8.13.10", "moment": "^2.29.1", "monaco-editor": "^0.31.1", - "monaco-mermaid": "^1.0.2", + "monaco-mermaid": "^1.0.3", "pako": "2.0.4", "random-word-slugs": "^0.1.6" }, diff --git a/yarn.lock b/yarn.lock index feeaeaad4f..c59d9ebe1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3155,7 +3155,7 @@ monaco-editor@^0.31.1: resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.31.1.tgz#67f597b3e45679d1f551237e12a3a42c4438b97b" integrity sha512-FYPwxGZAeP6mRRyrr5XTGHD9gRXVjy7GUzF4IPChnyt3fS5WrNxIkS8DNujWf6EQy0Zlzpxw8oTVE+mWI2/D1Q== -monaco-mermaid@^1.0.2: +monaco-mermaid@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/monaco-mermaid/-/monaco-mermaid-1.0.3.tgz#807bf5a0635723684029646b716a2ba97dd6a175" integrity sha512-SOtoCXxfUXCh8j09OhgambkQ8eqbifaK2YYt2lAo5YXIk/iRXdprvBVhLOJNx1gTMtRNINixALGaTy5StYfiqw==