Fix inputs and values attachments to be data-first#127
Open
Fix inputs and values attachments to be data-first#127
Conversation
|
⏭️ No files to mutate for |
Coverage report for
|
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
|
⏭️ No files to mutate for |
Coverage report for
|
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
Coverage report for
|
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
Coverage report for
|
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
Coverage report for
|
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
|
⏭️ No files to mutate for |
neSpecc
reviewed
Apr 17, 2026
| * @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 | ||
| */ |
Contributor
There was a problem hiding this comment.
add @example for items[0].content, etc
| } | ||
|
|
||
| wrapper.classList.add('editorjs-paragraph'); | ||
| onUpdate = (key: string, type: 'text' | 'value'): HTMLElement => { |
Contributor
There was a problem hiding this comment.
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 { |
Contributor
There was a problem hiding this comment.
Suggested change
| public registerKey(keyRaw: string, type: 'text' | 'value', initialData?: unknown): void { | |
| public registerDataKey(keyRaw: string, type: 'text' | 'value', initialData?: unknown): void { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.