import { describe, expect, it } from "vitest"; import { buildApp } from "../src/app.js"; import { openDb } from "../src/db.js"; const noToken = () => buildApp({ db: openDb(), apiToken: "" }); describe("product-page", () => { it("Scenario: Открытие по ссылке", async () => { const res = await noToken().inject({ method: "GET", url: "/" }); expect(res.statusCode).toBe(200); expect(res.headers["content-type"]).toContain("text/html"); expect(res.body).toContain("Виртуальный рекрутер"); expect(res.body).not.toContain("full_name"); }); it("Scenario: Другой язык", async () => { const res = await noToken().inject({ method: "GET", url: "/?lang=en" }); expect(res.body).toContain("Virtual Recruiter"); }); it("Scenario: язык из Accept-Language, чужой lang игнорируется", async () => { const res = await noToken().inject({ method: "GET", url: "/?lang=