Skip to content

Fix inputs and values attachments to be data-first#127

Open
gohabereg wants to merge 1 commit intomainfrom
fix/inputs-registration
Open

Fix inputs and values attachments to be data-first#127
gohabereg wants to merge 1 commit intomainfrom
fix/inputs-registration

Conversation

@gohabereg
Copy link
Copy Markdown
Member

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 2026

⏭️ No files to mutate for ./packages/model

@github-actions
Copy link
Copy Markdown

Coverage report for ./packages/dom-adapters

St.
Category Percentage Covered / Total
🟢 Statements
100% (+3.57% 🔼)
0/0
🟢 Branches
100% (+13.04% 🔼)
0/0
🟢 Functions 100% 0/0
🟢 Lines
100% (+3.57% 🔼)
0/0

Test suite run success

1 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 0d5817e

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 2026

⏭️ No files to mutate for ./packages/core

@github-actions
Copy link
Copy Markdown

Coverage report for ./packages/model

Caution

Test run failed

St.
Category Percentage Covered / Total
🟢 Statements
98.96% (-0.93% 🔻)
856/865
🟢 Branches
97.89% (-1.73% 🔻)
232/237
🟢 Functions
97.18% (-0.98% 🔻)
207/213
🟢 Lines
98.92% (-0.97% 🔻)
823/832
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / index.ts
95.65% (-4.35% 🔻)
86.67% (-13.33% 🔻)
96.77% (-3.23% 🔻)
95.52% (-4.48% 🔻)
🟢
... / index.ts
98.18% (-1.82% 🔻)
100%
96.97% (-3.03% 🔻)
98.15% (-1.85% 🔻)

Test suite run failed

Failed tests: 1/442. Failed suites: 1/25.
  ● EditorJSModel › should expose only the public API

    expect(received).toEqual(expected) // deep equality

    - Expected  - 0
    + Received  + 1

    @@ -4,10 +4,11 @@
        "constructor",
        "createCaret",
        "createDataNode",
        "devModeGetDocument",
        "format",
    +   "getDataNode",
        "getFragments",
        "getProperty",
        "getText",
        "initializeDocument",
        "insertData",

      38 |     const ownProperties = Object.getOwnPropertyNames(EditorJSModel.prototype);
      39 |
    > 40 |     expect(ownProperties.sort()).toEqual(allowedMethods.sort());
         |                                  ^
      41 |   });
      42 |
      43 |   describe('Caret updates on remote operations', () => {

      at Object.<anonymous> (src/EditorJSModel.spec.ts:40:34)

Report generated by 🧪jest coverage report action from 0d5817e

@github-actions
Copy link
Copy Markdown

Coverage report for ./packages/core

Caution

Test run failed

St.
Category Percentage Covered / Total
🟢 Statements
88.6% (-11.4% 🔻)
101/114
🟡 Branches
79.55% (-20.45% 🔻)
35/44
🟢 Functions 100% 25/25
🟢 Lines
87.74% (-12.26% 🔻)
93/106
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / BlockManager.ts
81.69% 68.97% 100% 80.6%

Test suite run failed

Failed tests: 3/43. Failed suites: 2/5.
  ● BlocksManager (unit, mocked deps) › #handleModelUpdate() › BlockAddedEvent handling › should throw when tool is not found

    expect(received).toContain(expected) // indexOf

    Expected substring: "[BlockManager] Block Tool missing-tool not found"
    Received string:    "adapter.getBlockIndex is not a function"

      453 |           await changedListener(event);
      454 |         } catch (error: unknown) {
    > 455 |           expect((error as Error).message).toContain('[BlockManager] Block Tool missing-tool not found');
          |                                            ^
      456 |         }
      457 |       });
      458 |

      at Object.<anonymous> (src/components/BlockManager.spec.ts:455:44)

  ● BlocksManager (unit, mocked deps) › #handleModelUpdate() › BlockAddedEvent handling › should log error when tool render fails

    TypeError: adapter.getBlockIndex is not a function

      270 |     // rendering will see correct adapter indices.
      271 |     for (const adapter of this.#adapters) {
    > 272 |       const current = adapter.getBlockIndex().blockIndex;
          |                               ^
      273 |
      274 |       if (current !== undefined && current >= index.blockIndex) {
      275 |         adapter.setBlockIndex(current + 1);

      at BlocksManager.getBlockIndex (src/components/BlockManager.ts:272:31)
      at BlocksManager.#handleModelUpdate (src/components/BlockManager.ts:245:43)
      at src/components/BlockManager.ts:123:85
      at Object.<anonymous> (src/components/BlockManager.spec.ts:481:15)

  ● BlocksManager (unit, mocked deps) › #handleModelUpdate() › BlockRemovedEvent handling › should dispatch BlockRemovedCoreEvent via EventBus

    TypeError: a.getBlockIndex is not a function

      338 |     const removedIndex = index.blockIndex;
      339 |
    > 340 |     const adapterIndex = this.#adapters.findIndex(a => a.getBlockIndex().blockIndex === removedIndex);
          |                                                          ^
      341 |
      342 |     if (adapterIndex !== -1) {
      343 |       const [removedAdapter] = this.#adapters.splice(adapterIndex, 1);

      at getBlockIndex (src/components/BlockManager.ts:340:58)
          at Array.findIndex (<anonymous>)
      at BlocksManager.findIndex (src/components/BlockManager.ts:340:41)
      at BlocksManager.#handleModelUpdate (src/components/BlockManager.ts:247:38)
      at src/components/BlockManager.ts:123:85
      at Object.<anonymous> (src/components/BlockManager.spec.ts:505:14)


  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (../../node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:21)

Report generated by 🧪jest coverage report action from 0d5817e

@github-actions
Copy link
Copy Markdown

Coverage report for ./packages/ot-server

St.
Category Percentage Covered / Total
🟡 Statements 70.97% 22/31
🔴 Branches 20% 1/5
🟡 Functions 75% 6/8
🟡 Lines 68.97% 20/29

Test suite run success

4 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 0d5817e

@github-actions
Copy link
Copy Markdown

Coverage report for ./packages/collaboration-manager

St.
Category Percentage Covered / Total
🟢 Statements 91.99% 356/387
🟢 Branches 84.06% 116/138
🟢 Functions 98.15% 53/54
🟢 Lines 91.88% 351/382

Test suite run success

117 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from 0d5817e

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 2026

⏭️ No files to mutate for ./packages/dom-adapters

* @param keyRaw - string data key to register
* @param type - node type: 'text' for contenteditable inputs, 'value' for arbitrary values
* @param initialData - optional initial data for the node
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add @example for items[0].content, etc

}

wrapper.classList.add('editorjs-paragraph');
onUpdate = (key: string, type: 'text' | 'value'): HTMLElement => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onUpdate = (key: string, type: 'text' | 'value'): HTMLElement => {
onDataUpdated = (key: string, type: 'text' | 'value'): HTMLElement => {

this.attachInput(dataKey, input);
}

public registerKey(keyRaw: string, type: 'text' | 'value', initialData?: unknown): void {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public registerKey(keyRaw: string, type: 'text' | 'value', initialData?: unknown): void {
public registerDataKey(keyRaw: string, type: 'text' | 'value', initialData?: unknown): void {

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