describe("joinTextblockBackward", () => {
// This is the existing test case
it("can join if first block is wrapped", () =>
apply(doc(blockquote(p("hi")), p("<a>there")), joinTextblockBackward, doc(blockquote(p("hi<a>there")))))
// This is the new test case
it("can join if inside a nested block", () =>
apply(doc(blockquote(blockquote(p("hi")), p("<a>there"))), joinTextblockBackward, doc(blockquote(blockquote(p("hi<a>there"))))))
})
Run the test.
Expected behavior
Test should pass. These two test cases should have similar behavior, i.e. the gap between hi and there should be removed.
Actual behavior
Test failed. joinTextblockBackward did nothing, because of the if condition step.slice.size >= afterPos - beforePos at here.
I'm testing joinTextblockBackward. I found that it doesn't work as expected when inside a nested block.
Steps to reproduce:
Expected behavior
Test should pass. These two test cases should have similar behavior, i.e. the gap between
hi
andthere
should be removed.Actual behavior
Test failed.
joinTextblockBackward
did nothing, because of the if conditionstep.slice.size >= afterPos - beforePos
at here.