feat(demo): add the jury guide and demonstration markers to the demo stand build

This commit is contained in:
shira committed 2026-10-10 01:27:17 +03:00
1 parent d365a05c96
commit 41206abbcf
32 files changed
+1096 -141

No files matched your search

@@ -0,0 +1,80 @@
.roles,
.steps,
.list {
display: grid;
gap: var(--space-4);
margin: 0;
padding: 0;
list-style: none;
}
.role {
display: grid;
gap: var(--space-2);
padding: var(--space-4) 0 var(--space-4) var(--space-4);
border-left: var(--line-strong) solid var(--color-accent);
}
.role-title {
margin: 0;
font-size: var(--font-size-l);
font-weight: var(--font-weight-bold);
line-height: var(--line-height-snug);
}
.account {
margin: 0;
color: var(--color-text-secondary);
font-size: var(--font-size-s);
}
/* Continues the numbering from the previous block through the start attribute. */
.steps {
gap: var(--space-3);
padding-left: var(--space-5);
list-style: decimal;
}
.steps li {
padding-left: var(--space-1);
}
.steps p {
margin: 0 0 var(--space-1);
}
.list {
gap: var(--space-2);
padding-left: var(--space-4);
list-style: disc;
}
.table-wrap {
overflow-x: auto;
}
.table {
width: 100%;
border-collapse: collapse;
font-size: var(--font-size-s);
}
.table th,
.table td {
padding: var(--space-2);
border-bottom: var(--line-thin) solid var(--color-divider);
text-align: left;
vertical-align: top;
}
.table code {
overflow-wrap: anywhere;
font-family: var(--font-mono);
font-size: var(--font-size-xs);
}
.account code {
overflow-wrap: anywhere;
font-family: var(--font-mono);
font-size: var(--font-size-xs);
}
@@ -0,0 +1,98 @@
import { renderToString } from "react-dom/server";
import { StaticRouter } from "react-router-dom";
import { describe, expect, it } from "vitest";
import { guideRoles } from "../model/guide";
import { JuryGuidePage } from "./jury-guide-page";
function render(): string {
return renderToString(
<StaticRouter location="/demo">
<JuryGuidePage />
</StaticRouter>,
);
}
function hrefs(html: string): string[] {
return [...html.matchAll(/<a[^>]*href="([^"]+)"/g)].map((match) => match[1] ?? "");
}
describe("jury guide page", () => {
it("renders one heading with the demonstration eyebrow and the memo title", () => {
const html = render();
expect(html.match(/<h1[\s>]/g)?.length).toBe(1);
expect(html).toMatch(/<h1[^>]*>Гид для жюри<\/h1>/);
expect(html).toContain("Демонстрационный стенд");
});
it("explains the product in the first section", () => {
const html = render();
expect(html).toContain("Что такое Lincodex");
expect(html).toContain("Заявленный уровень в анкете остается самооценкой");
});
it("separates the demonstration simulations from the working functionality", () => {
const html = render();
const simulations = html.indexOf("Что здесь демонстрационное");
const working = html.indexOf("Что работает без имитации");
expect(simulations).toBeGreaterThan(0);
expect(working).toBeGreaterThan(simulations);
expect(html).toContain("синтетические");
expect(html).toContain("не калибрована");
expect(html).toContain("смысловой анализ недоступен");
expect(html).toContain("ФСП не подключен");
expect(html).toContain("Экспресс-запуск показывает механику проверки");
});
it("numbers the route across the role blocks in one continuous sequence", () => {
const html = render();
const starts = [...html.matchAll(/<ol class="[^"]*" start="(\d+)">/g)].map((match) =>
Number(match[1]),
);
const lastBlock = guideRoles.at(-1)!;
expect(starts).toHaveLength(guideRoles.length);
expect(starts[0]).toBe(1);
expect(starts.at(-1)).toBe(
guideRoles.slice(0, -1).reduce((total, role) => total + role.steps.length, 0) + 1,
);
expect(lastBlock.steps.length).toBeGreaterThan(0);
});
it("names the account of every role block", () => {
const html = render();
expect(html).toContain("candidate@demo.lincodex.test");
expect(html).toContain("prepared-1@demo.lincodex.test");
expect(html).toContain("employer-alpha@demo.lincodex.test");
});
it("shows where the password comes from without printing its value", () => {
const html = render();
expect(html).toContain("DEMO_ACCOUNT_PASSWORD");
expect(html).toContain("deploy/demo/demo.env.example");
expect(html).not.toContain("synthetic demo stand only 2026");
});
it("renders every step link as a link of the guide", () => {
const html = render();
const links = guideRoles.flatMap((role) =>
role.steps.flatMap((step) => (step.link ? [step.link.to] : [])),
);
expect(links.length).toBeGreaterThan(0);
for (const to of links) {
expect(hrefs(html)).toContain(to);
}
});
it("states the limits: mail may be off and real people must not register", () => {
const html = render();
expect(html).toContain("Почта на стенде может быть отключена");
expect(html).toContain("Не регистрируйте на стенде реальных людей");
});
});
@@ -0,0 +1,128 @@
import { Page, Section, TextLink } from "../../../shared/ui";
import {
demonstrationItems,
guideAccounts,
guideLimits,
guideRoles,
workingItems,
} from "../model/guide";
import styles from "./jury-guide-page.module.css";
/** Step numbers run on across the role blocks, so the whole route reads as eight to thirteen steps. */
function firstStepNumbers(): number[] {
const starts: number[] = [];
let next = 1;
for (const role of guideRoles) {
starts.push(next);
next += role.steps.length;
}
return starts;
}
/**
* Memo for a jury member who opens the isolated demonstration stand without a
* briefing. It lists the route with the screens to open, the accounts, and the
* parts of the stand that are simulations. The route is shown only in a demo
* build (see routes), so nothing here reaches a production build.
*/
export function JuryGuidePage() {
const starts = firstStepNumbers();
return (
<Page
title="Гид для жюри"
eyebrow="Демонстрационный стенд"
lead="Короткий маршрут на синтетических данных: около восьми минут и две роли. Сначала прочитайте раздел «Что здесь демонстрационное»: он отделяет имитации от работающего функционала."
width="wide"
>
<Section title="Что такое Lincodex">
<p>
Lincodex помогает работодателям находить IT-специалистов по подтвержденным навыкам.
Заявленный уровень в анкете остается самооценкой, а категорию присваивает только результат
проверки.
</p>
</Section>
<Section
title="Маршрут за восемь минут"
description="Блоки идут по ролям. Перед каждым блоком войдите под указанным логином. Кнопки выхода в интерфейсе пока нет, поэтому роли удобнее вести в двух окнах: обычном и приватном."
>
<ol className={styles.roles}>
{guideRoles.map((role, index) => (
<li key={role.title} className={styles.role}>
<h3 className={styles["role-title"]}>{role.title}</h3>
<p className={styles.account}>
Логин: <code>{role.account}</code>
</p>
<ol className={styles.steps} start={starts[index]}>
{role.steps.map((step) => (
<li key={step.text}>
<p>{step.text}</p>
{step.link ? <TextLink to={step.link.to}>{step.link.label}</TextLink> : null}
</li>
))}
</ol>
</li>
))}
</ol>
</Section>
<Section
title="Что здесь демонстрационное"
description="Имитации и подготовленные данные. Они показывают механику, но не измеряют навык человека."
>
<ul className={styles.list}>
{demonstrationItems.map((item) => (
<li key={item}>{item}</li>
))}
</ul>
</Section>
<Section title="Что работает без имитации">
<ul className={styles.list}>
{workingItems.map((item) => (
<li key={item}>{item}</li>
))}
</ul>
</Section>
<Section title="Логины и пароль">
<p>
Пароль один для всех логинов ниже. Опубликованное значение по умолчанию - переменная
DEMO_ACCOUNT_PASSWORD из файла deploy/demo/demo.env.example. Если организатор задал свой
пароль, используйте его: он передается отдельно.
</p>
<div className={styles["table-wrap"]}>
<table className={styles.table}>
<thead>
<tr>
<th scope="col">Логин</th>
<th scope="col">Роль</th>
<th scope="col">Для чего</th>
</tr>
</thead>
<tbody>
{guideAccounts.map((account) => (
<tr key={account.login}>
<td>
<code>{account.login}</code>
</td>
<td>{account.role}</td>
<td>{account.purpose}</td>
</tr>
))}
</tbody>
</table>
</div>
</Section>
<Section title="Ограничения стенда">
<ul className={styles.list}>
{guideLimits.map((item) => (
<li key={item}>{item}</li>
))}
</ul>
</Section>
</Page>
);
}