Require browser acceptance to draw native feature pages through outline and bounded feature requests, reject legacy whole-pack fetches, and load Earth raster tiles without errors.
- commit
- 0deaa6862cd1767f1816d55574da11125d00f73b
- parent
- 2df65e928197171311bc4d8e281db233c10bea80
- author
- Dami <dami.etoile@gmail.com>
| M | tests/ | 43 | ++++++++++++++++++++++++++++++ |
@@ -25,6 +25,21 @@ async function island(page: Page) {
2525 };2626 }2727 28+interface SeamSnapshot {29+ world: string;30+ tileStats: { loaded: number; errors: number };31+ sync: { drawn: number };32+}33+34+async function seamSnapshot(page: Page): Promise<SeamSnapshot | null> {35+ return page.evaluate(() => {36+ const host = window as unknown as {37+ __atlasSeam?: { snapshot(): SeamSnapshot };38+ };39+ return host.__atlasSeam?.snapshot() ?? null;40+ });41+}42+2843 test.describe("the doorways", () => {2944 test("the root is a doorway to a real world URL", async ({ page }) => {3045 await page.goto("/");@@ -151,4 +166,32 @@ test.describe("the explorer page", () => {
151166 await page.goto("/");152167 await expect(page).toHaveURL(`/v/${MARS.slug}/${MARS.world}`);153168 });169+170+ test("native features arrive through demand pages and are drawn", async ({ page }) => {171+ const requested: string[] = [];172+ page.on("request", (request) => requested.push(request.url()));173+174+ await page.goto(`/v/${BEND.slug}/${BEND.world}`);175+ await expect.poll(async () => (await seamSnapshot(page))?.sync.drawn ?? 0, {176+ message: "the native feature pages never produced anything drawable",177+ timeout: 15_000,178+ }).toBeGreaterThan(0);179+180+ const paths = requested.map((raw) => new URL(raw).pathname);181+ expect(paths.some((path) => path.endsWith("/outline.json"))).toBeTruthy();182+ expect(paths.some((path) => path.includes("/features/") && path.endsWith(".json"))).toBeTruthy();183+ expect(paths.some((path) => path.endsWith("/data/features.pack"))).toBeFalsy();184+ });185+186+ test("Earth draws raster tiles without load errors", async ({ page }) => {187+ await page.goto(`/v/${EARTH.slug}/${EARTH.world}`);188+ await expect.poll(async () => (await seamSnapshot(page))?.tileStats.loaded ?? 0, {189+ message: "Earth's raster never loaded a tile",190+ timeout: 15_000,191+ }).toBeGreaterThan(0);192+193+ const snapshot = await seamSnapshot(page);194+ expect(snapshot?.world).toBe(EARTH.title);195+ expect(snapshot?.tileStats.errors).toBe(0);196+ });154197 });