fix(web): align bracket score-card row geometry
This commit is contained in:
1 parent
c9140b8622
commit
61f1db0e6a
2 files changed
+45
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
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 \}\}/,
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user