refactor(web): remove redundant history result column

This commit is contained in:
dahyeon committed 2026-07-25 07:37:32 -07:00
1 parent d269bdd92b
commit 03be85d07b
2 files changed
+30 -23

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
const homePageSource = await readFile(
new URL("../src/pages/HomePage.tsx", import.meta.url),
"utf8",
);
test("keeps past match history focused on the five summary columns", () => {
const colGroup = sourceForFunction("HistoryTableColGroup");
const header = sourceForFunction("HistoryTableHeader");
const skeleton = sourceForFunction("HistoryRecordsSkeleton");
assert.equal(colGroup.match(/<col(?:\s|\/|>)/g)?.length, 5);
assert.doesNotMatch(header, />결과<\/th>/);
assert.doesNotMatch(homePageSource, /공식 결과/);
assert.doesNotMatch(skeleton, /1팀 승리/);
assert.match(homePageSource, /colSpan=\{5\}/);
});
function sourceForFunction(name: string): string {
const start = homePageSource.indexOf(`function ${name}(`);
assert.notEqual(start, -1, `${name} should exist`);
const nextFunction = homePageSource.indexOf("\nfunction ", start + 1);
assert.notEqual(nextFunction, -1, `${name} should have a following function`);
return homePageSource.slice(start, nextFunction);
}