BRM-104: без адреса — другой способ связаться, понятный итог по регионам #100
@ -1,10 +1,11 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { pageHtml } from "../src/site.js";
|
||||
import { execFileSync } from "node:child_process";
|
||||
|
||||
// BRM-104: адрес задаётся явно — без CONTACT_EMAIL ссылки на почту нет вовсе (test/contact.test.js).
|
||||
test("BRM-87: адрес на «Рынке» и главной не прячется от посетителя", () => {
|
||||
for (const f of ["market.html"]) {
|
||||
const h = pageHtml(f, "ru");
|
||||
assert.match(h, /<a href="mailto:[^"@]+%40[^"@]+">[^<@]+@[^<@]+<\/a>/);
|
||||
}
|
||||
const h = execFileSync(process.execPath, ["--input-type=module", "-e",
|
||||
`import { homePage, pageHtml } from "./src/site.js"; process.stdout.write(JSON.stringify([pageHtml("market.html", "ru"), homePage("ru")]));`],
|
||||
{ env: { PATH: process.env.PATH, CONTACT_EMAIL: "hello@brand.example" }, encoding: "utf8" });
|
||||
for (const page of JSON.parse(h)) assert.match(page, /<a href="mailto:[^"@]+%40[^"@]+">[^<@]+@[^<@]+<\/a>/);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user