diff --git a/.vscode/settings.json b/.vscode/settings.json index c4bdcadd..aa0b0876 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "editor.formatOnSave": true, + "cSpell.blockCheckingWhenLineLengthGreaterThan": 150, "cSpell.words": [ "asyncable", "Browserslist", @@ -14,7 +15,8 @@ "pako", "Serde", "serdes", - "tailwindcss" + "tailwindcss", + "uparrow" ], "vitest.commandLine": "yarn test:unit", "vitest.enable": true, diff --git a/cypress/e2e/diagramUpdate.spec.ts b/cypress/e2e/diagramUpdate.spec.ts index 57ef1ba6..64a435b3 100644 --- a/cypress/e2e/diagramUpdate.spec.ts +++ b/cypress/e2e/diagramUpdate.spec.ts @@ -1,9 +1,10 @@ -import { typeInEditor, cmd } from './util'; +import { typeInEditor, cmd, getEditor } from './util'; describe('Auto sync tests', () => { beforeEach(() => { cy.clearLocalStorage(); cy.visit('/'); + cy.url().should('contain', '/edit#pako'); }); it('should dim diagram when code is edited', () => { @@ -49,7 +50,8 @@ describe('Auto sync tests', () => { }); it('supports commenting code out/in', () => { - typeInEditor(`{uparrow}${cmd}/`, { bottom: true, newline: false }); + getEditor().contains('Car').click(); + getEditor().get('textarea').type(`${cmd}/`); cy.get('#view').contains('Car').should('not.exist'); typeInEditor(`{uparrow}${cmd}/`); diff --git a/cypress/e2e/util.ts b/cypress/e2e/util.ts index be30c87d..e180f408 100644 --- a/cypress/e2e/util.ts +++ b/cypress/e2e/util.ts @@ -1,5 +1,5 @@ export const cmd = `{${Cypress.platform === 'darwin' ? 'meta' : 'ctrl'}}`; -const editor = () => cy.get('#editor textarea:first'); +export const getEditor = () => cy.get('#editor textarea:first'); interface EditorOptions { bottom?: boolean; @@ -11,12 +11,12 @@ export const typeInEditor = ( { bottom = true, newline = false }: EditorOptions = {} ) => { if (bottom) { - editor().type('{pageDown}'); + getEditor().type('{pageDown}'); } if (newline) { - editor().type('{enter}'); + getEditor().type('{enter}'); } - editor().type(text); + getEditor().type(text); }; const downloadsFolder = Cypress.config('downloadsFolder');