feat(site): tighten proof, contact, and inquiry delivery
Lead with Batch on the home page, drop the product changelog, add a domain note, and stop reporting success when SMTP fails. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import { validateInquiry } from "./schema.ts";
|
||||
import { offerIds } from "../../content/offer-ids.ts";
|
||||
|
||||
describe("validateInquiry", () => {
|
||||
const valid = {
|
||||
@@ -37,4 +38,24 @@ describe("validateInquiry", () => {
|
||||
assert.equal(result.ok, true);
|
||||
if (result.ok) assert.equal(result.data.company, undefined);
|
||||
});
|
||||
|
||||
it("accepts every published offer id", () => {
|
||||
for (const topic of offerIds) {
|
||||
const result = validateInquiry({ ...valid, topic });
|
||||
assert.equal(result.ok, true);
|
||||
if (result.ok) assert.equal(result.data.topic, topic);
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects an unknown topic", () => {
|
||||
const result = validateInquiry({ ...valid, topic: "casino" });
|
||||
assert.equal(result.ok, false);
|
||||
if (!result.ok) assert.equal(result.field, "topic");
|
||||
});
|
||||
|
||||
it("treats a blank topic as omitted", () => {
|
||||
const result = validateInquiry({ ...valid, topic: " " });
|
||||
assert.equal(result.ok, true);
|
||||
if (result.ok) assert.equal(result.data.topic, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user