summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-02 21:56:59 -0500
committerGitHub <noreply@github.com>2024-02-03 02:56:59 +0000
commit17ffea6cb907c12c1af47d3f6f27126f126b168f (patch)
tree2c350b999c7271387ac3466583f71411f6be13c9 /test
parentc4f248b0f95050fb373c898289b506d042a3731b (diff)
Text source generator function move (#611)
* Move functionality into TextSourceGenerator * Move extractSentence * Move isWhitespace
Diffstat (limited to 'test')
-rw-r--r--test/document-util.test.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/document-util.test.js b/test/document-util.test.js
index 8ced9d07..18a5d42c 100644
--- a/test/document-util.test.js
+++ b/test/document-util.test.js
@@ -19,12 +19,12 @@
import {fileURLToPath} from 'node:url';
import path from 'path';
import {afterAll, describe, expect, test} from 'vitest';
-import {DocumentUtil} from '../ext/js/dom/document-util.js';
+import {parseJson} from '../dev/json.js';
import {DOMTextScanner} from '../ext/js/dom/dom-text-scanner.js';
import {TextSourceElement} from '../ext/js/dom/text-source-element.js';
+import {TextSourceGenerator} from '../ext/js/dom/text-source-generator.js';
import {TextSourceRange} from '../ext/js/dom/text-source-range.js';
import {setupDomTest} from './fixtures/dom-test.js';
-import {parseJson} from '../dev/json.js';
const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -182,7 +182,8 @@ describe('Document utility tests', () => {
};
// Test docRangeFromPoint
- const source = DocumentUtil.getRangeFromPoint(0, 0, {
+ const textSourceGenerator = new TextSourceGenerator();
+ const source = textSourceGenerator.getRangeFromPoint(0, 0, {
deepContentScan: false,
normalizeCssZoom: true
});
@@ -217,7 +218,7 @@ describe('Document utility tests', () => {
}
// Test docSentenceExtract
- const sentenceActual = DocumentUtil.extractSentence(
+ const sentenceActual = textSourceGenerator.extractSentence(
source,
false,
sentenceScanExtent,