Skip to content

Improve Node.elements and Transforms.mergeNodes tests#1

Merged
nabbydude merged 2 commits intonabbydude:fix-testsfrom
12joan:fix-tests-pr-suggestions
Jan 20, 2026
Merged

Improve Node.elements and Transforms.mergeNodes tests#1
nabbydude merged 2 commits intonabbydude:fix-testsfrom
12joan:fix-tests-pr-suggestions

Conversation

@12joan
Copy link

@12joan 12joan commented Jan 19, 2026

Child PR of ianstormtaylor#6003

I've improved the poor-quality tests you identified, along with others in the same directories as them.

  • Node
    • elements
      • all, reverse - Modified the input data to actually include multiple elements to return, including nested elements
      • range, path - Removed these in favour of from and to
  • mergeNodes
    • path
      • block-nested - As you pointed out, this passes even without the match. I don't think the match is important to the intent of the test ("Can we merge two adjacent block-containing blocks?"), so I've removed it
      • text-hanging, text-hanging-nested - Again, the match was unnecessary, so I've removed it. Also, the tests were such that simply normalizing the editor is enough to cause them to pass, so I've disabled normalizing in these tests to force the Transforms.mergeNodes to transform the data itself.

@12joan 12joan changed the title Fix tests pr suggestions Improve Node.elements and Transforms.mergeNodes tests Jan 19, 2026
Copy link
Owner

@nabbydude nabbydude left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

@nabbydude nabbydude merged commit 250a671 into nabbydude:fix-tests Jan 20, 2026
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