import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import type { CandidateOrganizationCard, InvitationTerms } from "../../../shared/api/schemas";
import { InvitationPreview } from "./invitation-preview";
const card: CandidateOrganizationCard = {
id: "0199b4f2-7c1e-7d3a-9f00-aabbccddee01",
name: "Северный ветер",
description: "Платежная инфраструктура для малого бизнеса",
sphere: "Финтех",
contacts: { website: "https://north.example", email: null, phone: null, telegram: null },
verification_level: "e0",
};
const terms: InvitationTerms = {
role_title: "Middle Go-разработчик",
specialization: "backend",
grade: "middle",
offer_type: "full_time",
tasks: ["Развивать сервис выплат", "Перевести отчеты на события"],
team: "Пять бэкенд-разработчиков\nи QA-инженер",
tech_stack: ["Go", "PostgreSQL"],
work_formats: ["remote", "hybrid"],
location: "Москва",
communication_method: { channel: "video_call", details: "Созвон с тимлидом" },
salary: {
salary_from: 100000,
salary_to: 140000,
currency: "RUB",
period: "month",
tax_basis: "net",
},
package: {
bonus: { status: "provided", description: "Квартальная премия до 20%" },
equipment: { status: "provided", description: "Ноутбук и монитор" },
training: { status: "not_provided" },
health_insurance: { status: "not_provided" },
},
};
const text = (html: string) => html.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ");
describe("invitation preview", () => {
it("shows the company card and every term as the candidate sees them", () => {
const html = renderToStaticMarkup(