Merge pull request 'refactor(web): remove redundant history result column' (#8) from agent/remove-history-result-column into main
Reviewed-on: #8
This commit was merged in pull request #8.
This commit is contained in:
commit
79534cf43c
2 files changed
+30
-23
No files matched your search
@@ -85,7 +85,6 @@ function HistoryTableColGroup() {
|
||||
<col className="w-[88px]" />
|
||||
<col className="w-[132px]" />
|
||||
<col className="w-[72px]" />
|
||||
<col className="w-[116px]" />
|
||||
</colgroup>
|
||||
);
|
||||
}
|
||||
@@ -99,7 +98,6 @@ function HistoryTableHeader() {
|
||||
<th className="py-2.5 px-4 font-semibold">상태</th>
|
||||
<th className="py-2.5 px-4 font-semibold">맵</th>
|
||||
<th className="py-2.5 px-4 font-semibold">참가</th>
|
||||
<th className="py-2.5 px-4 font-semibold">결과</th>
|
||||
</tr>
|
||||
</thead>
|
||||
);
|
||||
@@ -156,14 +154,6 @@ function HistoryRecordsSkeleton({
|
||||
10명
|
||||
</SkeletonText>
|
||||
</td>
|
||||
<td className="py-2.5 px-4 text-xs text-base-content/50 whitespace-nowrap">
|
||||
<SkeletonText
|
||||
className="truncate"
|
||||
skeletonClassName="h-[1em] w-14"
|
||||
>
|
||||
1팀 승리
|
||||
</SkeletonText>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
@@ -205,10 +195,6 @@ function HistoryRecordsSkeleton({
|
||||
<SkeletonText skeletonClassName="h-[1em] w-8">
|
||||
10명
|
||||
</SkeletonText>
|
||||
<span className="invisible text-base-content/20">·</span>
|
||||
<SkeletonText skeletonClassName="h-[1em] w-14">
|
||||
1팀 승리
|
||||
</SkeletonText>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -682,20 +668,12 @@ export default function HomePage() {
|
||||
<td className="py-2.5 px-4 text-xs text-base-content/50 whitespace-nowrap">
|
||||
{match.participants.length}명
|
||||
</td>
|
||||
<td className="py-2.5 px-4 text-xs text-base-content/50 whitespace-nowrap">
|
||||
<Link
|
||||
to={`/match/${match.id}`}
|
||||
className="font-semibold text-base-content/45 hover:text-primary"
|
||||
>
|
||||
공식 결과
|
||||
</Link>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td
|
||||
colSpan={6}
|
||||
colSpan={5}
|
||||
className="py-6 px-4 text-sm text-base-content/35 text-center"
|
||||
>
|
||||
아직 내전 기록이 없습니다.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user