Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Fix names
meinzzzz4eef30f8b5a0
diff --git a/packages/ckeditor5-math/tests/__screenshots__/mathui.ts/MathUI--showUI---math-form-view-binding-should-execute-math-command-on-mainFormView-submit-event-1.png b/packages/ckeditor5-math/tests/__screenshots__/mathui.ts/MathUI--showUI---math-form-view-binding-should-execute-math-command-on-mainFormView-submit-event-1.pngnew file mode 100644index 0000000000..30a255f4a9Binary files /dev/null and b/packages/ckeditor5-math/tests/__screenshots__/mathui.ts/MathUI--showUI---math-form-view-binding-should-execute-math-command-on-mainFormView-submit-event-1.png differdiff --git a/packages/ckeditor5-math/tests/mathui.ts b/packages/ckeditor5-math/tests/mathui.tsindex a55fda523b..6317b5e66c 100644--- a/packages/ckeditor5-math/tests/mathui.ts+++ b/packages/ckeditor5-math/tests/mathui.ts@@ -168,13 +168,13 @@ describe( 'MathUI', () => {command.isEnabled = true;- expect( formView!.mathInputView.isReadOnly ).to.be.false;+ expect( formView!.mathLiveInputView.isReadOnly ).to.be.false;expect( formView!.saveButtonView.isEnabled ).to.be.false;expect( formView!.cancelButtonView.isEnabled ).to.be.true;command.isEnabled = false;- expect( formView!.mathInputView.isReadOnly ).to.be.true;+ expect( formView!.mathLiveInputView.isReadOnly ).to.be.true;expect( formView!.saveButtonView.isEnabled ).to.be.false;expect( formView!.cancelButtonView.isEnabled ).to.be.true;} );@@ -407,24 +407,32 @@ describe( 'MathUI', () => {setModelData( editor.model, '<paragraph>f[o]o</paragraph>' );} );- it( 'should bind mainFormView.mathInputView#value to math command value', () => {+ it( 'should bind mainFormView.mathLiveInputView#value to math command value', () => {const command = editor.commands.get( 'math' );- expect( formView!.mathInputView.value ).to.be.null;+ expect( formView!.mathLiveInputView.value ).to.be.null;command!.value = 'x^2';- expect( formView!.mathInputView.value ).to.equal( 'x^2' );+ expect( formView!.mathLiveInputView.value ).to.equal( 'x^2' );} );it( 'should execute math command on mainFormView#submit event', () => {const executeSpy = vi.spyOn( editor, 'execute' );- formView!.mathInputView.value = 'x^2';+ formView!.mathLiveInputView.value = 'x^2';formView!.fire( 'submit' );expect( executeSpy.mock.lastCall?.slice( 0, 2 ) ).toMatchObject( [ 'math', 'x^2' ] );} );+ it( 'should sync mathLiveInputView and rawLatexInputView', () => {+ formView!.mathLiveInputView.value = 'x^2';+ expect( formView!.rawLatexInputView.value ).to.equal( 'x^2' );++ formView!.rawLatexInputView.value = '\\frac{1}{2}';+ expect( formView!.mathLiveInputView.value ).to.equal( '\\frac{1}{2}' );+ } );+it( 'should hide the balloon on mainFormView#cancel if math command does not have a value', () => {mathUIFeature._showUI();formView!.fire( 'cancel' );