Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate tests to Typescript #135

Merged
merged 1 commit into from
Jun 8, 2024
Merged

Conversation

fedemp
Copy link
Contributor

@fedemp fedemp commented Mar 30, 2024

No description provided.

@tony
Copy link
Collaborator

tony commented May 18, 2024

@fedemp Sorry I missed this! Can you rebase?

@fedemp
Copy link
Contributor Author

fedemp commented May 23, 2024

@tony Done 👍

@tony
Copy link
Collaborator

tony commented May 25, 2024

@fedemp First, thank you for this!

When testing this, what command are you using? What browser? OS?

For me, env CHROME_BIN=$(which chromium) yarn test errors on main @ ac60fc7 and this PR.

Log
yarn run v1.22.22
$ ckeditor5-package-tools test
Entry file saved in "~/project/ckeditor5-math/tmp/tests-entry-point.js".

START:
Webpack bundling...
asset �[1m�[32mcommons.js�[39m�[22m 4.57 MiB �[1m�[32m[emitted]�[39m�[22m (name: commons) (id hint: commons)
asset �[1m�[32mruntime.js�[39m�[22m 8.89 KiB �[1m�[32m[emitted]�[39m�[22m (name: runtime)
asset �[1m�[32mtests-entry-point.3049700137.js�[39m�[22m 1.03 KiB �[1m�[32m[emitted]�[39m�[22m (name: tests-entry-point.3049700137)
Entrypoint �[1mtests-entry-point.3049700137�[39m�[22m 4.58 MiB = �[1m�[32mruntime.js�[39m�[22m 8.89 KiB �[1m�[32mcommons.js�[39m�[22m 4.57 MiB �[1m�[32mtests-entry-point.3049700137.js�[39m�[22m 1.03 KiB
webpack 5.88.2 compiled �[1m�[32msuccessfully�[39m�[22m in 7547 ms
�[32m25 05 2024 06:36:51.728:INFO [karma-server]: �[39mKarma v6.4.2 server started at http://localhost:9876/
�[32m25 05 2024 06:36:51.729:INFO [launcher]: �[39mLaunching browsers CHROME_LOCAL with concurrency unlimited
�[32m25 05 2024 06:36:51.731:INFO [launcher]: �[39mStarting browser Chrome
�[32m25 05 2024 06:36:52.625:INFO [Chrome 125.0.0.0 (Linux x86_64)]: �[39mConnected on socket pvlVUndjZ67UoKGkAAAB with id 39184839
  AutoMath - integration
    ✔ should load Clipboard plugin
    ✔ should load Undo plugin
    ✔ has proper name
    use fake timers
      ✖ replaces pasted text with mathtex element after 100ms
      ✖ replaces pasted text with inline mathtex element after 100ms
      ✖ can undo auto-mathing
      ✖ works for not collapsed selection inside single element
      ✖ works for not collapsed selection over a few elements
      ✖ inserts mathtex in-place (collapsed selection)
      ✖ inserts math in-place (non-collapsed selection)
      ✖ does nothing if pasted two equation as text
  CKEditor5 Math DLL
    ✔ exports Math
    ✔ exports AutoformatMath
  Math
    ✔ should be loaded
    ✔ should load MathEditing plugin
    ✔ should load Widget plugin
    ✔ should load MathUI plugin
    ✔ should load AutoMath plugin
    ✔ has proper name
  MathUI
    init
      ✔ should register click observer
      ✔ should create #formView
      math toolbar button
        ✔ should be registered
        ✔ should be toggleable button
        ✔ should be bound to the math command
        ✔ should call #_showUI upon #execute
    _showUI()
      ✔ should not work if the math command is disabled
      ✔ should not throw if the UI is already visible
      ✖ should add #mainFormView to the balloon and attach the balloon to the selection when text fragment is selected
      ✖ should add #mainFormView to the balloon and attach the balloon to the selection when selection is collapsed
      ✖ should disable #mainFormView element when math command is disabled
      _hideUI()
        ✔ should remove the UI from the balloon
        ✔ should focus the `editable` by default
        ✔ should focus the `editable` before before removing elements from the balloon
        ✔ should not throw an error when views are not in the `balloon`
        ✔ should clear ui#update listener from the ViewDocument
      keyboard support
        ✔ should show the UI on Ctrl+M keystroke
        ✔ should prevent default action on Ctrl+M keystroke
        ✔ should make stack with math visible on Ctrl+M keystroke - no math
        ✔ should make stack with math visible on Ctrl+M keystroke - math
        ✔ should hide the UI after Esc key press (from editor) and not focus the editable
        ✔ should not hide the UI after Esc key press (from editor) when UI is open but is not visible
      mouse support
        ✔ should hide the UI and not focus editable upon clicking outside the UI
        ✔ should not hide the UI upon clicking inside the the UI
      math form view
        ✔ should mark the editor UI as focused when the #formView is focused
        binding
          ✔ should bind mainFormView.mathInputView#value to math command value
          ✖ should execute math command on mainFormView#submit event
          ✔ should hide the balloon on mainFormView#cancel if math command does not have a value
          ✔ should hide the balloon after Esc key press if math command does not have a value
          ✔ should blur math input element before hiding the view

Finished in 1.566 secs / 0.173 secs @ 06:36:54 GMT-0500 (Central Daylight Time)

SUMMARY:
✔ 37 tests completed
✖ 12 tests failed

FAILED TESTS:
  AutoMath - integration
    use fake timers
      ✖ replaces pasted text with mathtex element after 100ms
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:77:4)

      ✖ replaces pasted text with inline mathtex element after 100ms
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:92:4)

      ✖ can undo auto-mathing
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:107:4)

      ✖ works for not collapsed selection inside single element
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:124:4)

      ✖ works for not collapsed selection over a few elements
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:135:4)

      ✖ inserts mathtex in-place (collapsed selection)
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:146:4)

      ✖ inserts math in-place (non-collapsed selection)
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:159:4)

      ✖ does nothing if pasted two equation as text
        Chrome 125.0.0.0 (Linux x86_64)
      data.stopPropagation is not a function
      Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-data.stopPropagation is not a function
      TypeError: data.stopPropagation is not a function
          at Mixin.eval (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?:64:26)
          at Mixin.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js?:159:47)
          at fireListenerFor (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:143:13)
          at Document.fire (webpack://@isaul32/ckeditor5-math/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js?:81:17)
          at pasteHtml (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:183:32)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/automath.js?:172:4)

  MathUI
    _showUI()
      ✖ should add #mainFormView to the balloon and attach the balloon to the selection when text fragment is selected
        Chrome 125.0.0.0 (Linux x86_64)
      AssertError: expected add to be called with exact arguments 
      { view: 
         { element: 
            { '0': [Object],
              '1': [Object],
              '2': [Object],
              '3': [Object],
              'data-ck-expando': 'e80c99ea7e8262f94f3496ecad44b10b4' },
           isRendered: true,
           locale: 
            { uiLanguage: 'en',
              contentLanguage: 'en',
              uiLanguageDirection: 'ltr',
              contentLanguageDirection: 'ltr',
              translations: undefined,
              t: [Function] },
           t: [Function],
           _viewCollections: 
            { _items: [Object],
              _itemMap: {},
              _idProperty: 'id',
              _bindToExternalToInternalMap: {},
              _bindToInternalToExternalMap: {},
              _skippedIndexesFromExternal: [] },
           _unboundChildren: 
            { _items: [Object],
              _itemMap: {},
              _idProperty: 'viewUid',
              _bindToExternalToInternalMap: {},
              _bindToInternalToExternalMap: {},
              _skippedIndexesFromExternal: [],
              _parentElement: null,
              id: 'effb7f352d4c6d31f59f2fc61654e904c' },
           render: [Function],
           focusTracker: 
            { _elements: {},
              _nextEventLoopTimeout: null,
              isFocused: [Getter/Setter],
              focusedElement: [Getter/Setter] },
           keystrokes: { _listener: {} },
           _focusables: 
            { _items: [Object],
              _itemMap: {},
              _idProperty: 'viewUid',
              _bindToExternalToInternalMap: {},
              _bindToInternalToExternalMap: {},
              _skippedIndexesFromExternal: [],
              _parentElement: null },
           _focusCycler: 
            { focusables: [Object],
              focusTracker: [Object],
              keystrokeHandler: [Object],
              actions: [Object] },
           saveButtonView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              _focusDelayed: null,
              _bindTemplate: [Object],
              ariaLabel: [Getter/Setter],
              ariaLabelledBy: [Getter/Setter],
              class: [Getter/Setter],
              labelStyle: [Getter/Setter],
              icon: [Getter/Setter],
              isEnabled: [Getter/Setter],
              isOn: [Getter/Setter],
              isVisible: [Getter/Setter],
              isToggleable: [Getter/Setter],
              keystroke: [Getter/Setter],
              label: [Getter/Setter],
              role: [Getter/Setter],
              tabindex: [Getter/Setter],
              tooltip: [Getter/Setter],
              tooltipPosition: [Getter/Setter],
              type: [Getter/Setter],
              withText: [Getter/Setter],
              withKeystroke: [Getter/Setter],
              children: [Object],
              labelView: [Object],
              iconView: [Object],
              keystrokeView: [Object],
              _tooltipString: [Getter/Setter],
              template: [Object],
              viewUid: 'e15c3ae5b20f0ec8d66fe22e588ef94ac' },
           mathInputView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              isEmpty: [Getter/Setter],
              isFocused: [Getter/Setter],
              placeholder: [Getter/Setter],
              fieldView: [Object],
              label: [Getter/Setter],
              isEnabled: [Getter/Setter],
              errorText: [Getter/Setter],
              infoText: [Getter/Setter],
              class: [Getter/Setter],
              labelView: [Object],
              _bindTemplate: [Object],
              statusView: [Object],
              fieldWrapperChildren: [Object],
              _statusText: [Getter/Setter],
              template: [Object],
              value: null,
              isReadOnly: false,
              viewUid: 'ef18a997e2816f5679778ec52ae443662' },
           displayButtonView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              _focusDelayed: null,
              _bindTemplate: [Object],
              ariaLabel: [Getter/Setter],
              ariaLabelledBy: [Getter/Setter],
              class: [Getter/Setter],
              labelStyle: [Getter/Setter],
              icon: [Getter/Setter],
              isEnabled: [Getter/Setter],
              isOn: [Getter/Setter],
              isVisible: [Getter/Setter],
              isToggleable: [Getter/Setter],
              keystroke: [Getter/Setter],
              label: [Getter/Setter],
              role: [Getter/Setter],
              tabindex: [Getter/Setter],
              tooltip: [Getter/Setter],
              tooltipPosition: [Getter/Setter],
              type: [Getter/Setter],
              withText: [Getter/Setter],
              withKeystroke: [Getter/Setter],
              children: [Object],
              labelView: [Object],
              iconView: [Object],
              keystrokeView: [Object],
              _tooltipString: [Getter/Setter],
              template: [Object],
              toggleSwitchView: [Object],
              viewUid: 'e816737f068715d263cfe2bc85b08c2c3' },
           cancelButtonView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              _focusDelayed: null,
              _bindTemplate: [Object],
              ariaLabel: [Getter/Setter],
              ariaLabelledBy: [Getter/Setter],
              class: [Getter/Setter],
              labelStyle: [Getter/Setter],
              icon: [Getter/Setter],
              isEnabled: [Getter/Setter],
              isOn: [Getter/Setter],
              isVisible: [Getter/Setter],
              isToggleable: [Getter/Setter],
              keystroke: [Getter/Setter],
              label: [Getter/Setter],
              role: [Getter/Setter],
              tabindex: [Getter/Setter],
              tooltip: [Getter/Setter],
              tooltipPosition: [Getter/Setter],
              type: [Getter/Setter],
              withText: [Getter/Setter],
              withKeystroke: [Getter/Setter],
              children: [Object],
              labelView: [Object],
              iconView: [Object],
              keystrokeView: [Object],
              _tooltipString: [Getter/Setter],
              template: [Object],
              viewUid: 'ebc1cf117e2910e4a8e0b9c9add6479be' },
           previewEnabled: true,
           previewLabel: 
            { element: {},
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              text: [Getter/Setter],
              for: [Getter/Setter],
              id: 'ck-editor__label_ec96a3789810d801e4a07f332c910fa48',
              _bindTemplate: [Object],
              template: [Object],
              viewUid: 'ebf296ed4f004976fd4ce9ad1c099125e' },
           mathView: 
            { element: {},
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              engine: [Function: engine],
              lazyLoad: undefined,
              previewUid: 'math-preview-eae0c4cd62a656749f6f159644bc49108',
              katexRenderOptions: {},
              previewClassName: [],
              value: [Getter/Setter],
              display: [Getter/Setter],
              template: [Object],
              viewUid: 'e8800e5cb744fd12fe6a37217fd1704c6' },
           template: 
            { tag: 'form',
              attributes: [Object],
              children: [Object],
              _isRendered: true,
              _revertData: null },
           viewUid: 'ec042ef5c53a760bef32f151bed67d853' },
        position: 
         { target: {},
           positions: 
            [ [Function: southArrowNorth],
              [Function: southArrowNorthWest],
              [Function: southArrowNorthEast] ] } }  position: { target: {} } }
          at Object.fail (node_modules/sinon/pkg/sinon.js:158:25)
          at failAssertion (node_modules/sinon/pkg/sinon.js:115:20)
          at assert.<computed> [as calledWithExactly] (node_modules/sinon/pkg/sinon.js:141:17)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/mathui.js?:143:17)

      ✖ should add #mainFormView to the balloon and attach the balloon to the selection when selection is collapsed
        Chrome 125.0.0.0 (Linux x86_64)
      AssertError: expected add to be called with exact arguments 
      { view: 
         { element: 
            { '0': [Object],
              '1': [Object],
              '2': [Object],
              '3': [Object],
              'data-ck-expando': 'e1fc6c3aa5d901d8f68cbef91e170516e' },
           isRendered: true,
           locale: 
            { uiLanguage: 'en',
              contentLanguage: 'en',
              uiLanguageDirection: 'ltr',
              contentLanguageDirection: 'ltr',
              translations: undefined,
              t: [Function] },
           t: [Function],
           _viewCollections: 
            { _items: [Object],
              _itemMap: {},
              _idProperty: 'id',
              _bindToExternalToInternalMap: {},
              _bindToInternalToExternalMap: {},
              _skippedIndexesFromExternal: [] },
           _unboundChildren: 
            { _items: [Object],
              _itemMap: {},
              _idProperty: 'viewUid',
              _bindToExternalToInternalMap: {},
              _bindToInternalToExternalMap: {},
              _skippedIndexesFromExternal: [],
              _parentElement: null,
              id: 'e184bae23346c2cb1a3860dc3bdb5d9ac' },
           render: [Function],
           focusTracker: 
            { _elements: {},
              _nextEventLoopTimeout: null,
              isFocused: [Getter/Setter],
              focusedElement: [Getter/Setter] },
           keystrokes: { _listener: {} },
           _focusables: 
            { _items: [Object],
              _itemMap: {},
              _idProperty: 'viewUid',
              _bindToExternalToInternalMap: {},
              _bindToInternalToExternalMap: {},
              _skippedIndexesFromExternal: [],
              _parentElement: null },
           _focusCycler: 
            { focusables: [Object],
              focusTracker: [Object],
              keystrokeHandler: [Object],
              actions: [Object] },
           saveButtonView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              _focusDelayed: null,
              _bindTemplate: [Object],
              ariaLabel: [Getter/Setter],
              ariaLabelledBy: [Getter/Setter],
              class: [Getter/Setter],
              labelStyle: [Getter/Setter],
              icon: [Getter/Setter],
              isEnabled: [Getter/Setter],
              isOn: [Getter/Setter],
              isVisible: [Getter/Setter],
              isToggleable: [Getter/Setter],
              keystroke: [Getter/Setter],
              label: [Getter/Setter],
              role: [Getter/Setter],
              tabindex: [Getter/Setter],
              tooltip: [Getter/Setter],
              tooltipPosition: [Getter/Setter],
              type: [Getter/Setter],
              withText: [Getter/Setter],
              withKeystroke: [Getter/Setter],
              children: [Object],
              labelView: [Object],
              iconView: [Object],
              keystrokeView: [Object],
              _tooltipString: [Getter/Setter],
              template: [Object],
              viewUid: 'e8765225e76aa699aa754df9773b80934' },
           mathInputView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              isEmpty: [Getter/Setter],
              isFocused: [Getter/Setter],
              placeholder: [Getter/Setter],
              fieldView: [Object],
              label: [Getter/Setter],
              isEnabled: [Getter/Setter],
              errorText: [Getter/Setter],
              infoText: [Getter/Setter],
              class: [Getter/Setter],
              labelView: [Object],
              _bindTemplate: [Object],
              statusView: [Object],
              fieldWrapperChildren: [Object],
              _statusText: [Getter/Setter],
              template: [Object],
              value: null,
              isReadOnly: false,
              viewUid: 'e94ff8cda7b8c97f104d505a9d2a2a531' },
           displayButtonView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              _focusDelayed: null,
              _bindTemplate: [Object],
              ariaLabel: [Getter/Setter],
              ariaLabelledBy: [Getter/Setter],
              class: [Getter/Setter],
              labelStyle: [Getter/Setter],
              icon: [Getter/Setter],
              isEnabled: [Getter/Setter],
              isOn: [Getter/Setter],
              isVisible: [Getter/Setter],
              isToggleable: [Getter/Setter],
              keystroke: [Getter/Setter],
              label: [Getter/Setter],
              role: [Getter/Setter],
              tabindex: [Getter/Setter],
              tooltip: [Getter/Setter],
              tooltipPosition: [Getter/Setter],
              type: [Getter/Setter],
              withText: [Getter/Setter],
              withKeystroke: [Getter/Setter],
              children: [Object],
              labelView: [Object],
              iconView: [Object],
              keystrokeView: [Object],
              _tooltipString: [Getter/Setter],
              template: [Object],
              toggleSwitchView: [Object],
              viewUid: 'ecd09127eb91e3f139e9b6aa2b60f726a' },
           cancelButtonView: 
            { element: [Object],
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              _focusDelayed: null,
              _bindTemplate: [Object],
              ariaLabel: [Getter/Setter],
              ariaLabelledBy: [Getter/Setter],
              class: [Getter/Setter],
              labelStyle: [Getter/Setter],
              icon: [Getter/Setter],
              isEnabled: [Getter/Setter],
              isOn: [Getter/Setter],
              isVisible: [Getter/Setter],
              isToggleable: [Getter/Setter],
              keystroke: [Getter/Setter],
              label: [Getter/Setter],
              role: [Getter/Setter],
              tabindex: [Getter/Setter],
              tooltip: [Getter/Setter],
              tooltipPosition: [Getter/Setter],
              type: [Getter/Setter],
              withText: [Getter/Setter],
              withKeystroke: [Getter/Setter],
              children: [Object],
              labelView: [Object],
              iconView: [Object],
              keystrokeView: [Object],
              _tooltipString: [Getter/Setter],
              template: [Object],
              viewUid: 'eb77f30787a5d2ef14e4c68aea88e4c0b' },
           previewEnabled: true,
           previewLabel: 
            { element: {},
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              text: [Getter/Setter],
              for: [Getter/Setter],
              id: 'ck-editor__label_e625c7a784aafd61bca85e986dac32170',
              _bindTemplate: [Object],
              template: [Object],
              viewUid: 'e2ad667dda984b0e3e609b1cdf726a955' },
           mathView: 
            { element: {},
              isRendered: true,
              locale: [Object],
              t: [Function],
              _viewCollections: [Object],
              _unboundChildren: [Object],
              render: [Function],
              engine: [Function: engine],
              lazyLoad: undefined,
              previewUid: 'math-preview-ebf943886b41e4fb8f7b4fc452ef1e66a',
              katexRenderOptions: {},
              previewClassName: [],
              value: [Getter/Setter],
              display: [Getter/Setter],
              template: [Object],
              viewUid: 'e5abd6b35ddce220eb3c4af62274775ff' },
           template: 
            { tag: 'form',
              attributes: [Object],
              children: [Object],
              _isRendered: true,
              _revertData: null },
           viewUid: 'e0558c9ff0b059095ad41f1bc948c0363' },
        position: 
         { target: {},
           positions: 
            [ [Function: southArrowNorth],
              [Function: southArrowNorthWest],
              [Function: southArrowNorthEast] ] } }  position: { target: {} } }
          at Object.fail (node_modules/sinon/pkg/sinon.js:158:25)
          at failAssertion (node_modules/sinon/pkg/sinon.js:115:20)
          at assert.<computed> [as calledWithExactly] (node_modules/sinon/pkg/sinon.js:141:17)
          at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/mathui.js?:158:17)

      ✖ should disable #mainFormView element when math command is disabled
        Chrome 125.0.0.0 (Linux x86_64)
      AssertionError: expected false to be true

      + expected - actual

      -false
      +true
      
    at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/mathui.js?:174:53)


      math form view
        binding
          ✖ should execute math command on mainFormView#submit event
            Chrome 125.0.0.0 (Linux x86_64)
          AssertionError: expected '' to equal 'x^2'

      + expected - actual

      +x^2
      
    at Context.eval (webpack://@isaul32/ckeditor5-math/./tests/mathui.js?:405:66)


info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Node v18.12.1

@tony
Copy link
Collaborator

tony commented Jun 8, 2024

I get the same error with TypeScript (#135) that I get with JS - both this PR and ac60fc7 are broken.

However I will merge this doesn't get blocked. TypeScript-based tests are very welcomed.

@tony tony merged commit 3e1008e into isaul32:master Jun 8, 2024
tony added a commit that referenced this pull request Jun 8, 2024
tony added a commit that referenced this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants