fix: stabilize competition results flow

This commit is contained in:
dahyeon committed 2026-07-13 13:55:08 +00:00
1 parent 3bd3120eb1
commit a88562b208
20 files changed
+411 -65

No files matched your search

@@ -3,8 +3,20 @@ import test from "node:test";
import {
getTeamProgressErrorContent,
isConsistentTeamProgressSnapshot,
shouldOfferTeamSelection,
} from "../src/pages/match-team-progress-state.ts";
test("offers team selection when the caller cannot be resolved to a team", () => {
assert.equal(shouldOfferTeamSelection([{ status: 401 }], undefined), true);
assert.equal(shouldOfferTeamSelection([{ status: 403 }], undefined), true);
});
test("does not offer team selection once a team is named or the failure is unrelated", () => {
assert.equal(shouldOfferTeamSelection([{ status: 401 }], "team-a"), false);
assert.equal(shouldOfferTeamSelection([{ status: 404 }], undefined), false);
assert.equal(shouldOfferTeamSelection([{ status: 503 }], undefined), false);
});
test("only accepts Competition and team snapshots with the same revision", () => {
assert.equal(
isConsistentTeamProgressSnapshot({ revision: 7 }, { revision: 7 }),