Skip to content

Commit

Permalink
Merge pull request mermaid-js#606 from HeroProtagonist/bug/605_commen…
Browse files Browse the repository at this point in the history
…t_shortcuts

Enable comments in/out shortcut command
  • Loading branch information
sidharthv96 authored Jan 23, 2022
2 parents f211316 + 0175955 commit 54c3a08
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions cypress/integration/diagramUpdate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,14 @@ describe('Auto sync tests', () => {
cy.get('#view').should('not.have.class', 'outOfSync');
cy.getLocalStorage('codeStore').snapshot();
});

it('supports commenting code out/in', () => {
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('#view').contains('Car').should('exist');
});
});
2 changes: 1 addition & 1 deletion cypress/snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3155,10 +3155,10 @@ 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:
version "1.0.2"
resolved "https://registry.yarnpkg.com/monaco-mermaid/-/monaco-mermaid-1.0.2.tgz#a96d2c5dfbf9fc591cb7c61dff40a3d188021337"
integrity sha512-H0waK3QyTklsE3hKW4bvDFt+8Wcfghszi125wQVS89gzlHZMxZh5w1RqQe85d4FSmjwc3t1o71pCkyEYiZJiXg==
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==

mri@^1.1.0:
version "1.1.6"
Expand Down

0 comments on commit 54c3a08

Please sign in to comment.