17 lines
1.0 KiB
JavaScript
17 lines
1.0 KiB
JavaScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { homePage, pageHtml, CONTACT_MAIL } from "../src/site.js";
|
|
|
|
test("Сценарий: способ связи одинаков на главной и на «Рынке», слова про задачу не встречаются", () => {
|
|
for (const lang of ["ru", "kk", "en"]) {
|
|
// BRM-87: «@» записан кодом (@ и %40), чтобы адрес не подменял Cloudflare
|
|
const dec = (h) => h.replaceAll("@", "@").replaceAll("%40", "@");
|
|
const home = dec(homePage(lang));
|
|
const market = dec(pageHtml("market.html", lang));
|
|
assert.ok(home.includes(CONTACT_MAIL) && market.includes(CONTACT_MAIL), lang);
|
|
assert.ok(home.includes(`href="mailto:${CONTACT_MAIL}"`) && market.includes(`href="mailto:${CONTACT_MAIL}"`), lang);
|
|
assert.doesNotMatch(home + market, /к задаче|тапсырмаға|on the task/);
|
|
if (lang === "ru") assert.doesNotMatch((home + market).replace(/<[^>]+>/g, " "), /задач|BRM-\d+/i);
|
|
}
|
|
});
|