Skip to content

Commit

Permalink
Add comment explaining leading whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonherbert committed Sep 25, 2024
1 parent 5f179a3 commit 528fbc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion prosemirror-client/src/cqlInput/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ describe("utils", () => {
]);
});

// @todo: the following tests begin with whitespace because this is how the
// editor behaves to leave a gap for insertions at the beginning of the
// document. It'd be better were this not necessary, perhaps by hiding it as
// an implementation detail.
test("should map tokens to text positions with a tag at the beginning", async () => {
const text = await getTextFromTokenRanges("+tag:test");
const text = await getTextFromTokenRanges(" +tag:test");

expect(text).toEqual(["tag", "test", ""]);
});
Expand Down

0 comments on commit 528fbc6

Please sign in to comment.