diff --git a/.vscode/settings.json b/.vscode/settings.json index e6ed169..0ba75df 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,6 +24,7 @@ "dist", "node_modules", "yarn.lock", + "src/editor/core/draw/particle/latex/utils" ], "typescript.tsdk": "node_modules/typescript/lib", "editor.codeActionsOnSave": { diff --git a/cypress/integration/menus/latex.spec.ts b/cypress/integration/menus/latex.spec.ts new file mode 100644 index 0000000..a52441c --- /dev/null +++ b/cypress/integration/menus/latex.spec.ts @@ -0,0 +1,37 @@ +import Editor from '../../../src/editor' + +describe('菜单-LaTeX', () => { + + beforeEach(() => { + cy.visit('http://localhost:3000/canvas-editor/') + + cy.get('canvas').first().as('canvas').should('have.length', 1) + }) + + const text = 'canvas-editor' + + it('LaTeX', () => { + cy.getEditor().then((editor: Editor) => { + editor.listener.saved = function (payload) { + const data = payload.data + + expect(data[0].type).to.eq('latex') + + expect(data[0].value).to.eq(text) + } + + editor.command.executeSelectAll() + + editor.command.executeBackspace() + + cy.get('.menu-item__latex').click() + + cy.get('.dialog-option__item [name="value"]').type(text) + + cy.get('.dialog-menu button').eq(1).click() + + cy.get('@canvas').type('{ctrl}s') + }) + }) + +}) diff --git a/index.html b/index.html index 38a7e7d..73751df 100644 --- a/index.html +++ b/index.html @@ -173,6 +173,9 @@
;
+}
+
+const SYMB: Record