From 5ea4c2c2da4471ed94af5654e083139a4f707f1b Mon Sep 17 00:00:00 2001 From: kpcto Date: Wed, 26 Aug 2026 22:36:28 +0000 Subject: [PATCH] Remove tests/mailto.test.js --- tests/mailto.test.js | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 tests/mailto.test.js diff --git a/tests/mailto.test.js b/tests/mailto.test.js deleted file mode 100644 index 30b8ad9..0000000 --- a/tests/mailto.test.js +++ /dev/null @@ -1,33 +0,0 @@ -import test from "node:test"; -import assert from "node:assert/strict"; -import { buildMailtoUrl } from "../js/mailto.js"; - -test("builds a plain mailto URL when there is no subject or body", () => { - assert.equal(buildMailtoUrl({ to: "ada@example.com" }), "mailto:ada@example.com"); -}); - -test("includes subject and body as URL-encoded query parameters", () => { - const url = buildMailtoUrl({ - to: "owner@example.com", - subject: "Hello, Ada!", - body: "Line one\nLine two & ", - }); - - assert.ok(url.startsWith("mailto:owner@example.com?")); - - const params = new URL(url).searchParams; - assert.equal(params.get("subject"), "Hello, Ada!"); - assert.equal(params.get("body"), "Line one\nLine two & "); -}); - -test("omits empty subject and body", () => { - const url = buildMailtoUrl({ to: "owner@example.com", subject: "", body: "" }); - assert.equal(url, "mailto:owner@example.com"); -}); - -test("encodes spaces and special characters so the mail client opens pre-filled", () => { - const url = buildMailtoUrl({ to: "o@example.com", subject: "a b", body: "x&y=z" }); - const params = new URL(url).searchParams; - assert.equal(params.get("subject"), "a b"); - assert.equal(params.get("body"), "x&y=z"); -});