Add integration tests for EditorDocument class

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
testing

Research direction

Start with the EditorDocument class and its serialized method, then trace how each listed method reaches child entities. Add assertions for constructor, block and node operations, and finish with a real-life scenario covering block and node changes; done means all listed behaviors are verified through serialized output.

Written by the indexing model from the issue text.

Description

By integration tests we need to check that all calls are being propagated into child entities through the whole model

All checks should be done by assertion on serialized method of EditorDocument

Method Comment
constructor check that the whole model is initialized with data passed to constructor
addBlock check that block is created and initialized with data passed to the method
updateValue check that value of related ValueNode is updated
updateTuneData check if related BlockTune value is updated
insertText check that related TextNode value is updated
removeText check that related TextNode value is updated
format check that related TextNode value is updated
unformat check that related TextNode value is updated

Final test case should assert on "real-life" scenario like adding/removing some blocks and updating their nodes

Dominant language
TypeScript
Stars
12
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from editor-js/document-model

All issues in editor-js/document-model

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.