diff --git a/cypress/e2e/diagramUpdate.spec.ts b/cypress/e2e/diagramUpdate.spec.ts index b6b415f3..533a1adc 100644 --- a/cypress/e2e/diagramUpdate.spec.ts +++ b/cypress/e2e/diagramUpdate.spec.ts @@ -9,8 +9,10 @@ describe('Auto sync tests', () => { it('should dim diagram when code is edited', () => { cy.contains('Auto sync').click(); cy.get('#view').should('not.have.class', 'outOfSync'); + cy.get('#view').should('not.contain.text', 'Diagram out of sync.'); getEditor().type(' C --> Test'); cy.get('#view').should('have.class', 'outOfSync'); + cy.get('#view').should('contain.text', 'Diagram out of sync.'); cy.getLocalStorage('codeStore').snapshot(); }); @@ -19,7 +21,9 @@ describe('Auto sync tests', () => { cy.get('#view').should('not.have.class', 'outOfSync'); getEditor().type(' C --> Test'); cy.get('#view').should('have.class', 'outOfSync'); + cy.get('#view').should('contain.text', 'Diagram out of sync.'); getEditor().type(`${cmd}{enter}`); + cy.get('#view').should('not.contain.text', 'Diagram out of sync.'); cy.get('#view').should('not.have.class', 'outOfSync'); }); diff --git a/src/lib/components/view.svelte b/src/lib/components/view.svelte index bb6d9f2d..8cf21549 100644 --- a/src/lib/components/view.svelte +++ b/src/lib/components/view.svelte @@ -5,6 +5,7 @@ import panzoom from 'svg-pan-zoom'; import type { State, ValidatedState } from '$lib/types'; import { logEvent } from '$lib/util/stats'; + import { cmdKey } from '$lib/util/util'; let code = ''; let config = ''; @@ -109,6 +110,12 @@