fix(game8): drop the Battle Pass label Fandom does not print
Game8 heads Genshin's pass "Battle Pass - Moontrace"; Fandom lists "Moontrace" and files the category in a column. The label minted a second id for one event, so every battle pass since the Fandom source landed has been on the calendar twice, and a reader reported it. Both sources now mint the same id and merge fuses them by id. The two Game8 ids that moved, Frostfarer and Moontrace (the only ones git history shows ever shipped), go in RETIRED_IDS so readers' marks follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c8fa7febc
commit
59403ca2cc
8 files changed
+122
-28
No files matched your search
@@ -164,11 +164,23 @@ describe("genshin fixture specifics", () => {
|
||||
|
||||
// Sourced from a one-cell "Availability Period" range rather than
|
||||
// Start/End rows — the other table shape on the same page.
|
||||
expect(byTitle.get("Battle Pass - Frostfarer")?.endsAt).toBe(
|
||||
expect(byTitle.get("Frostfarer")?.endsAt).toBe(
|
||||
"2026-09-21T00:00:00.000Z",
|
||||
);
|
||||
});
|
||||
|
||||
test("a leading Battle Pass label is not part of the name", async () => {
|
||||
// Fandom lists the same pass as plain `Frostfarer` and puts the category in
|
||||
// its Type(s) column. Keeping Game8's label minted a second ID for one
|
||||
// event, and the calendar showed every battle pass twice.
|
||||
const events = await runAdapter(
|
||||
genshinGame8,
|
||||
"fixtures/genshin/game8-events-2026-08-14",
|
||||
);
|
||||
expect(events.some((e) => /^battle pass/i.test(e.title))).toBe(false);
|
||||
expect(events.map((e) => e.id)).toContain("genshin:frostfarer:2026-08-12");
|
||||
});
|
||||
|
||||
test("year-less summary rows produce no events", async () => {
|
||||
// The page's summary tables show "08/12 - 08/24" with no year. Those must
|
||||
// be skipped, not year-guessed — and they must not duplicate the detail
|
||||
@@ -1967,12 +1979,15 @@ describe("Genshin Impact wiki (the fifth Fandom template)", () => {
|
||||
expect(result.events.map((e) => e.id)).toContain(expected.id);
|
||||
}
|
||||
|
||||
// Fandom contributes net-new events Game8 did not list (total 20 merged events)
|
||||
expect(result.events.length).toBe(20);
|
||||
// Fandom contributes net-new events Game8 did not list (total 19 merged
|
||||
// events). This read 20 until 2026-10-14, and the twentieth was the battle
|
||||
// pass listed twice — `Battle Pass - Frostfarer` beside `Frostfarer`.
|
||||
expect(result.events.length).toBe(19);
|
||||
expect(result.events.filter((e) => /frostfarer/i.test(e.title))).toHaveLength(1);
|
||||
expect(result.conflicts).toHaveLength(0);
|
||||
|
||||
// Corroboration bonus applies to overlapping events (0.85 -> 0.95)
|
||||
const corroborated = result.events.filter((e) => e.confidence > 0.85);
|
||||
expect(corroborated.length).toBe(5);
|
||||
expect(corroborated.length).toBe(6);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,7 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { parseImportData } from "../src/client/state/export.ts";
|
||||
import {
|
||||
RETIRED_IDS,
|
||||
carryForward,
|
||||
carryDaily,
|
||||
carryMarks,
|
||||
@@ -94,3 +96,48 @@ describe("when the reader marked both rows", () => {
|
||||
expect(out).toEqual({ [NEW]: { at: "2026-09-24T00:00:00.000Z" } });
|
||||
});
|
||||
});
|
||||
|
||||
const PASS = "genshin:battle-pass-moontrace:2026-09-23";
|
||||
const BARE = "genshin:moontrace:2026-09-23";
|
||||
|
||||
describe("RETIRED_IDS", () => {
|
||||
test("names the two battle passes Game8 minted with their label", () => {
|
||||
expect(RETIRED_IDS[PASS]).toBe(BARE);
|
||||
expect(RETIRED_IDS["genshin:battle-pass-frostfarer:2026-08-12"]).toBe(
|
||||
"genshin:frostfarer:2026-08-12",
|
||||
);
|
||||
});
|
||||
|
||||
test("never retires an id onto another retired id", () => {
|
||||
for (const to of Object.values(RETIRED_IDS)) {
|
||||
expect(RETIRED_IDS[to]).toBeUndefined();
|
||||
}
|
||||
});
|
||||
|
||||
test("is the table a load uses when none is given", () => {
|
||||
const out = carryMarks({ [PASS]: { at: "2026-09-24T00:00:00.000Z" } });
|
||||
expect(Object.keys(out)).toEqual([BARE]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("an export made before the ids moved", () => {
|
||||
test("imports onto the new ids", () => {
|
||||
const data = parseImportData({
|
||||
format: "gacha-tracker-export",
|
||||
progress: { [PASS]: { status: "done", at: "2026-10-01T00:00:00.000Z" } },
|
||||
daily: { [PASS]: { days: ["2026-09-24"], at: "2026-09-24T00:00:00.000Z" } },
|
||||
ignored: { [PASS]: { at: "2026-09-24T00:00:00.000Z" } },
|
||||
});
|
||||
expect(Object.keys(data?.progress ?? {})).toEqual([BARE]);
|
||||
expect(Object.keys(data?.daily ?? {})).toEqual([BARE]);
|
||||
expect(Object.keys(data?.ignored ?? {})).toEqual([BARE]);
|
||||
});
|
||||
|
||||
test("so does one from before progress existed", () => {
|
||||
const data = parseImportData({
|
||||
format: "gacha-tracker-export",
|
||||
completions: { [PASS]: { at: "2026-10-01T00:00:00.000Z" } },
|
||||
});
|
||||
expect(data?.progress?.[BARE]?.status).toBe("done");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user