Add the Johto and Kanto atlas to the Map tab
Checks / web (push) Failing after 17s
Private ROM checks / private-rom (push) Failing after 14m39s

The Map tab draws the region's Town Map from the ROM with the player's
landmark, the visited flypoints as Fly destinations and the landmarks
whose maps are ported. Kanto opens with the Fly map's Indigo Plateau
rule. Landmark positions and flypoints are compared with the pinned
PRET source.

Closes #36

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
samyandClaude Opus 5.5 committed 2026-10-03 20:34:29 +02:00
1 parent cdee576818
commit 29248172bd
13 files changed
+536 -30

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
import { test, expect, type Page } from "@playwright/test";
import { existsSync } from "node:fs";
import { resolve } from "node:path";
const romPath = resolve(
process.env.CRYSTAL_ROM_PATH ?? "Pokemon - Crystal Version (UE) (V1.1) [C][!].gbc",
);
test.beforeEach(() => test.skip(!existsSync(romPath), "Requires the local user ROM."));
async function start(page: Page) {
await page.route("**/src/game/runtime.ts", async (route) => {
const response = await route.fetch(),
source = await response.text();
const needle = "const world = new GameWorld(assets);";
expect(source).toContain(needle);
// Fixture worlds stand in for a saved session, so no introduction runs.
expect(source).toContain("this.world?.beginIntro();");
await route.fulfill({
response,
body: source.replace("this.world?.beginIntro();", "").replace(
needle,
`const { pokedexFixtureWorld } = await import('/tests/pokedex-fixture.ts'); const world = pokedexFixtureWorld(assets);`,
),
});
});
await page.clock.install({ time: new Date("2026-09-22T12:00:00") });
await page.goto("/");
await page.locator("#rom-file").setInputFiles(romPath);
await expect(page.locator("#status")).toContainText("verified");
await page.clock.pauseAt(new Date("2026-09-22T12:05:00"));
await page.locator("#play").click();
}
test("the Map tab shows the Johto atlas with the player and open areas", async ({ page }) => {
const errors: string[] = [];
page.on("pageerror", (error) => errors.push(error.message));
await start(page);
await page.locator("#tab-map").click();
const atlas = page.locator("#atlas");
await expect(atlas).toBeVisible();
await expect(page.locator("#atlas-title")).toHaveText("Johto");
await expect(page.locator("#atlas-regions button")).toHaveCount(0);
await expect(page.locator("#atlas-here")).toHaveText("You are in NEW BARK TOWN.");
await expect(page.locator("#atlas-map")).toHaveAttribute("aria-label", "Johto map, you are in NEW BARK TOWN");
const open = page.locator("#atlas-open li");
await expect(open.first()).toHaveText("NEW BARK TOWN");
await expect(page.locator("#atlas-open")).toContainText("VIOLET CITY");
await expect(page.locator("#atlas-open")).not.toContainText("AZALEA TOWN");
expect(errors).toEqual([]);
});