34 lines
1012 B
TypeScript
34 lines
1012 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
import test from "node:test";
|
|
import { SERIES_SCORE_CARD_GEOMETRY } from "../src/components/competition/series-score-card-geometry.ts";
|
|
|
|
const component = await readFile(
|
|
new URL(
|
|
"../src/components/competition/SeriesScoreCard.tsx",
|
|
import.meta.url,
|
|
),
|
|
"utf8",
|
|
);
|
|
|
|
test("keeps bracket entry rows equal by overlaying their divider", () => {
|
|
assert.equal(
|
|
SERIES_SCORE_CARD_GEOMETRY.height -
|
|
SERIES_SCORE_CARD_GEOMETRY.borderWidth * 2 -
|
|
SERIES_SCORE_CARD_GEOMETRY.headerHeight,
|
|
SERIES_SCORE_CARD_GEOMETRY.entryHeight * 2,
|
|
);
|
|
assert.match(
|
|
component,
|
|
/className=\{\s*isBracket\s*\?\s*"relative"\s*:\s*"divide-y divide-base-content\/8"\s*\}/,
|
|
);
|
|
assert.match(
|
|
component,
|
|
/className="pointer-events-none absolute inset-x-0 border-t border-base-content\/8"/,
|
|
);
|
|
assert.match(
|
|
component,
|
|
/style=\{\{ top: SERIES_SCORE_CARD_GEOMETRY\.entryHeight \}\}/,
|
|
);
|
|
});
|