Open History to see the last commit
1import { getTranslationsSnapshot, GTProvider } from "gt-react";
2import { expect, it } from "vite-plus/test";
3
4import { initializeI18n } from "~/i18n/initializeI18n";
5import { render } from "../../../test/render";
6import { TerminalContextInlineChip } from "./TerminalContextInlineChip";
7
8it.each([
9 { lineEnd: 7, label: "ターミナル 2 7 行目" },
10 { lineEnd: 9, label: "ターミナル 2 7–9 行目" },
11])("shows the exact Japanese line label $label", async ({ lineEnd, label }) => {
12 initializeI18n(() => {});
13 const translations = await getTranslationsSnapshot("ja");
14 await using screen = await render(
15 <GTProvider locale="ja" translations={translations}>
16 <TerminalContextInlineChip
17 terminalLabel="ターミナル 2"
18 lineStart={7}
19 lineEnd={lineEnd}
20 text="terminal output"
21 detailsMode="popover"
22 />
23 </GTProvider>,
24 );
25
26 await expect.element(screen.getByText(label, { exact: true })).toBeVisible();
27});