Rewrite test descriptions

They originals didn't explain what the tests do.

We could test the contents of the range but that
would be testing the Range API, rather than our
use of it.

The tests test how we use that API for these
scenarios so their descriptions should say this.
This commit is contained in:
Tom Byers
2020-09-15 17:07:01 +01:00
parent 956f5d4c3e
commit b4d985e071

View File

@@ -344,7 +344,7 @@ describe('API key', () => {
});
test("the copied selection shouldn't include the prefix of the id", () => {
test("the copied selection (range) should start after the prefix of the id", () => {
// that selection (a range) should have a startOffset past the first two nodes:
// index 0: text node containing the whitespace before the prefix
@@ -388,7 +388,7 @@ describe('API key', () => {
})
test("the copied selection should match the id", () => {
test("the copied selection (range) should start at the default position", () => {
// that selection (a range) shouldn't call setStart to avoid the prefix:
expect(rangeMock.setStart).not.toHaveBeenCalled();