hasolidit-mcp 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,61 @@
1
+ import { test, expect } from "./test.ts";
2
+
3
+ // A known long-lived thread with multiple pages
4
+ const THREAD_URL =
5
+ "https://www.hasolidit.com/kehila/threads/%D7%94%D7%90%D7%9D-%D7%A2%D7%9C%D7%99-%D7%9C%D7%91%D7%A8%D7%95%D7%97-%D7%9E%D7%99%D7%A9%D7%A8%D7%90%D7%9C.34810/";
6
+
7
+ test.describe("view_thread", () => {
8
+ test("extracts posts from a thread", async ({ page }) => {
9
+ await page.goto(THREAD_URL);
10
+ await page.waitForSelector(".message--post", { timeout: 30000 });
11
+
12
+ // Thread title
13
+ const title = await page.locator("h1.p-title-value").textContent();
14
+ expect(title?.trim().length).toBeGreaterThan(0);
15
+
16
+ // Posts exist
17
+ const posts = page.locator("article.message--post");
18
+ const count = await posts.count();
19
+ expect(count).toBeGreaterThan(0);
20
+
21
+ // First post structure
22
+ const first = posts.first();
23
+
24
+ const author = await first
25
+ .locator("h4.message-name")
26
+ .textContent();
27
+ expect(author?.trim().length).toBeGreaterThan(0);
28
+
29
+ const timeEl = first.locator(".message-attribution-main time").first();
30
+ const datetime = await timeEl.getAttribute("datetime");
31
+ expect(datetime).toBeTruthy();
32
+
33
+ const content = await first
34
+ .locator(".message-body .bbWrapper")
35
+ .first()
36
+ .innerText();
37
+ expect(content.trim().length).toBeGreaterThan(0);
38
+
39
+ const postLink = first.locator("a.message-attribution-gadget");
40
+ const href = await postLink.getAttribute("href");
41
+ expect(href).toContain("/post-");
42
+ });
43
+
44
+ test("pagination works", async ({ page }) => {
45
+ await page.goto(THREAD_URL);
46
+ await page.waitForSelector(".message--post", { timeout: 30000 });
47
+
48
+ // This thread should have multiple pages
49
+ const pageNav = page.locator(".pageNav-page");
50
+ const pageCount = await pageNav.count();
51
+ expect(pageCount).toBeGreaterThan(1);
52
+
53
+ // Navigate to page 2
54
+ const page2Url = THREAD_URL.replace(/\/$/, "") + "/page-2";
55
+ await page.goto(page2Url);
56
+ await page.waitForSelector(".message--post", { timeout: 30000 });
57
+
58
+ const posts = page.locator("article.message--post");
59
+ expect(await posts.count()).toBeGreaterThan(0);
60
+ });
61
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2024",
4
+ "module": "nodenext",
5
+ "moduleResolution": "nodenext",
6
+ "strict": true,
7
+ "noEmit": true,
8
+ "skipLibCheck": true
9
+ },
10
+ "include": ["src/**/*.ts", "tests/**/*.ts"]
11
+ }