feat(portfolio): rebuild w-make.com as a bilingual editorial studio
Give clients a real IA, SMTP contact to eldov@w-make.de, and live Batch evidence instead of a single-page placeholder. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import { validateInquiry } from "./schema.ts";
|
||||
|
||||
describe("validateInquiry", () => {
|
||||
const valid = {
|
||||
name: "Anna Müller",
|
||||
email: "anna@example.com",
|
||||
company: "Glaswerk",
|
||||
message: "Wir brauchen eine belastbare Abbildung unseres Satzprozesses.",
|
||||
locale: "de",
|
||||
website: "",
|
||||
};
|
||||
|
||||
it("accepts a complete inquiry", () => {
|
||||
const result = validateInquiry(valid);
|
||||
assert.equal(result.ok, true);
|
||||
if (result.ok) {
|
||||
assert.equal(result.data.email, "anna@example.com");
|
||||
assert.equal(result.data.company, "Glaswerk");
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects a filled honeypot", () => {
|
||||
const result = validateInquiry({ ...valid, website: "https://spam.test" });
|
||||
assert.equal(result.ok, false);
|
||||
if (!result.ok) assert.equal(result.code, "spam");
|
||||
});
|
||||
|
||||
it("rejects short messages and invalid email", () => {
|
||||
assert.equal(validateInquiry({ ...valid, message: "Hallo" }).ok, false);
|
||||
assert.equal(validateInquiry({ ...valid, email: "not-an-email" }).ok, false);
|
||||
});
|
||||
|
||||
it("allows an empty company field", () => {
|
||||
const result = validateInquiry({ ...valid, company: " " });
|
||||
assert.equal(result.ok, true);
|
||||
if (result.ok) assert.equal(result.data.company, undefined);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user