refactor(web): restyle home schedule and results as divided lists
Replace the panel cards on the home page with section lists separated by horizontal rules, sharing one schedule row layout. Remove the obsolete home history test and record the design QA notes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
cc358697d4
commit
9064340584
3 files changed
+236
-200
No files matched your search
@@ -1,32 +0,0 @@
|
||||
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("shares the four history columns between records and the loading state", () => {
|
||||
const columns = sourceForFunction("HistoryTableColumns");
|
||||
const skeleton = sourceForFunction("HistoryRecordsSkeleton");
|
||||
const records = sourceForFunction("HistoryRecords");
|
||||
|
||||
assert.equal(columns.match(/<col(?:\s|\/|>)/g)?.length, 4);
|
||||
assert.deepEqual(
|
||||
Array.from(columns.matchAll(/<th\b[^>]*>\s*([^<]+?)\s*<\/th>/g), (match) => match[1]),
|
||||
["일정", "대회", "상태·결과", "참가"],
|
||||
);
|
||||
assert.match(skeleton, /<HistoryTableColumns\s*\/>/);
|
||||
assert.match(records, /<HistoryTableColumns\s*\/>/);
|
||||
assert.doesNotMatch(skeleton, /<HistoryResult\b/);
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in new issue
Block a user