aboutsummaryrefslogtreecommitdiff
path: root/test/domains/readability-test.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-28 21:17:13 +0530
committerAman Kumar <145339995+amankumarsingh77@users.noreply.github.com>2026-08-02 19:12:46 +0530
commitea11182a0e8cb62d208b5b53a60c98c8bdef9e9a (patch)
tree665fb355b902e5f067694d1e953039f6713e8245 /test/domains/readability-test.ts
parent91f5ad12fc04264e0423b37c4871c826bb98a66b (diff)
feat!: remove the deep-research feature
The harness ships browser tools; orchestrating a multi-agent research workflow on top of them is the agent's job, not this extension's. Drops the skill, the /deep-research command, and the web-search-researcher subagent config. browser_web_search and browser_read_page are untouched — the two tests that covered their pure parsers move to test/domains/, where the test glob still picks them up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'test/domains/readability-test.ts')
-rw-r--r--test/domains/readability-test.ts60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/domains/readability-test.ts b/test/domains/readability-test.ts
new file mode 100644
index 0000000..211229d
--- /dev/null
+++ b/test/domains/readability-test.ts
@@ -0,0 +1,60 @@
+import { test, describe } from "node:test";
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
+import { extractReadable, type PageCapture } from "../../src/domains/readpage/readability";
+
+const fixture = (name: string): PageCapture =>
+ JSON.parse(readFileSync(join(import.meta.dirname, "fixtures", name), "utf8")) as PageCapture;
+
+describe("pure readability extractor", () => {
+ test("S10: article body text is present", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(page.text.includes("Chrome DevTools Protocol lets tools instrument"));
+ });
+
+ test("S10: article headings are preserved", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(page.text.includes("Sessions and Targets"));
+ });
+
+ test("S10: nav boilerplate is dropped", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(!page.text.includes("Home Products Blog"));
+ });
+
+ test("S10: footer boilerplate is dropped", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(!page.text.includes("Copyright 2026"));
+ });
+
+ test("S10: high-link-density promo block is dropped", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(!page.text.includes("Subscribe here for our newsletter"));
+ });
+
+ test("S10: paragraph/heading structure preserved as markdown", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(page.text.includes("## Sessions and Targets"));
+ });
+
+ test("S10: title and url passed through", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(page.title === "How the Chrome DevTools Protocol Works" && page.url.startsWith("https://"));
+ });
+
+ test("S10: word count reflects the article body", () => {
+ const page = extractReadable(fixture("article-capture.json"));
+ assert.ok(page.wordCount > 40);
+ });
+
+ test("S11: structure-less page falls back to non-empty body text", () => {
+ const page = extractReadable(fixture("no-article-capture.json"));
+ assert.ok(page.text.length > 0);
+ });
+
+ test("S11: fallback body text carries the real content", () => {
+ const page = extractReadable(fixture("no-article-capture.json"));
+ assert.ok(page.text.includes("Your account is active"));
+ });
+});