Fix document->doc
diff --git a/packages/dom/test/text-quote/describe.test.ts b/packages/dom/test/text-quote/describe.test.ts
index 47e9d68..dafdac6 100644
--- a/packages/dom/test/text-quote/describe.test.ts
+++ b/packages/dom/test/text-quote/describe.test.ts
@@ -40,7 +40,7 @@
it('works with custom scope', async () => {
const { html, range } = testCases['minimal prefix'];
const doc = domParser.parseFromString(html, 'text/html');
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//b/text()'), 15);
scope.setEnd(evaluateXPath(doc, '//b/text()'), 30); // "not to annotate"
const result = await describeTextQuote(hydrateRange(range, doc), scope);
@@ -55,7 +55,7 @@
it('strips part of the range outside the scope', async () => {
const { html, range } = testCases['simple'];
const doc = domParser.parseFromString(html, 'text/html');
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//b/text()'), 6);
scope.setEnd(evaluateXPath(doc, '//b/text()'), 17); // "ipsum dolor"
const result = await describeTextQuote(hydrateRange(range, doc), scope);
diff --git a/packages/dom/test/text-quote/match.test.ts b/packages/dom/test/text-quote/match.test.ts
index 5fea7a3..8254a48 100644
--- a/packages/dom/test/text-quote/match.test.ts
+++ b/packages/dom/test/text-quote/match.test.ts
@@ -121,7 +121,7 @@
const doc = domParser.parseFromString(html, 'text/html');
// Use the substring ‘ipsum dolor amet’ as scope.
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//b/text()'), 6);
scope.setEnd(evaluateXPath(doc, '//b/text()'), 22);
await testMatcher(doc, scope, selector, expected);
@@ -132,7 +132,7 @@
const doc = domParser.parseFromString(html, 'text/html');
// Use the substring ‘sum dolor am’ as scope.
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//i/text()'), 2);
scope.setEnd(evaluateXPath(doc, '//u/text()'), 2);
await testMatcher(doc, scope, selector, expected);
@@ -142,7 +142,7 @@
const { html, selector, expected } = testCases['across elements'];
const doc = domParser.parseFromString(html, 'text/html');
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//b'), 1); // before the <i>
scope.setEnd(evaluateXPath(doc, '//b'), 4); // before the " yada yada"
await testMatcher(doc, scope, selector, expected);
@@ -152,7 +152,7 @@
const { html, selector } = testCases['simple'];
const doc = domParser.parseFromString(html, 'text/html');
- const scope = document.createRange();
+ const scope = doc.createRange();
await testMatcher(doc, scope, selector, []);
});
@@ -160,7 +160,7 @@
const { html, selector } = testCases['simple'];
const doc = domParser.parseFromString(html, 'text/html');
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//b/text()'), 0);
scope.setEnd(evaluateXPath(doc, '//b/text()'), 19);
await testMatcher(doc, scope, selector, []);
@@ -170,7 +170,7 @@
const { html, selector } = testCases['simple'];
const doc = domParser.parseFromString(html, 'text/html');
- const scope = document.createRange();
+ const scope = doc.createRange();
scope.setStart(evaluateXPath(doc, '//b/text()'), 13);
scope.setEnd(evaluateXPath(doc, '//b/text()'), 32);
await testMatcher(doc, scope, selector, []);