fix(codes): read Wuthering Waves codes after Game8 renamed the heading
Game8 dropped "All" from "Wuthering Waves All Active Codes" around 2026-10-25, and the exact match rejected every refresh since, freezing the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
09ca39056f
commit
d290e65211
File diff suppressed because one or more lines are too long
@@ -59,7 +59,7 @@ export const CODE_SOURCES = [
|
|||||||
game8Table(
|
game8Table(
|
||||||
"wuwa",
|
"wuwa",
|
||||||
"https://game8.co/games/Wuthering-Waves/archives/453149",
|
"https://game8.co/games/Wuthering-Waves/archives/453149",
|
||||||
/^Wuthering Waves All Active Codes$/i,
|
/^Wuthering Waves (?:All )?Active Codes$/i,
|
||||||
),
|
),
|
||||||
game8Table(
|
game8Table(
|
||||||
"endfield",
|
"endfield",
|
||||||
|
|||||||
@@ -76,3 +76,14 @@ test("a reward shared with the code's cell, or listed with bullets, reads as tex
|
|||||||
]);
|
]);
|
||||||
expect(codes.every((c) => c.expiresAt === null)).toBe(true);
|
expect(codes.every((c) => c.expiresAt === null)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Wuthering Waves' codes survive Game8 dropping 'All' from the heading", async () => {
|
||||||
|
// "Wuthering Waves All Active Codes" became "Wuthering Waves Active Codes" around
|
||||||
|
// 2026-10-25, and the exact match froze the list for two weeks.
|
||||||
|
const source = CODE_SOURCES.find((s) => s.id === "wuwa-game8-codes")!;
|
||||||
|
const ctx = { now: "2026-11-07T00:00:00.000Z", sourceUrl: source.url, sourceId: source.id, game: source.game };
|
||||||
|
const read = async (date: string) =>
|
||||||
|
(source.parse(await Bun.file(`fixtures/wuwa/game8-codes-${date}.html`).text(), ctx) as Array<{ code: string }>).map((c) => c.code);
|
||||||
|
expect(await read("2026-11-07")).toEqual(["TRAINOFSOULS", "BLOOMINGFLOWERS", "SCHOOLLIFE", "WUTHERINGGIFT"]);
|
||||||
|
expect(await read("2026-10-18")).toEqual(["WUTHERINGGIFT"]);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user