Fix world entry readiness and mobile startup test

This commit is contained in:
dingo
2026-09-10 11:09:51 -04:00
parent 1bd5d487e2
commit c86f4c1f24
3 changed files with 12 additions and 3 deletions
+8 -1
View File
@@ -5,8 +5,8 @@ async function enter(page, name = 'Wayfarer') {
await expect(page.locator('#connection-status')).toHaveText('World online');
await page.getByLabel('Character name').fill(name);
await page.getByRole('button', { name: 'Enter world' }).click();
await expect(page.locator('#game-controls')).toBeVisible();
await expectWorldReady(page);
await expect(page.locator('#game-controls')).toBeVisible();
}
async function expectWorldReady(page, characterId?: string) {
@@ -80,6 +80,13 @@ test('desktop renders models, moves authoritatively, gathers, and reconnects', a
test('mobile controls fit and move the character', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
// Hold authentication at the network boundary: entry must stay unavailable
// until it completes, even when the world preview has already loaded.
await page.route('**/api/me', async route => {
await expect(page.getByRole('button', { name: 'Enter world' })).toBeDisabled();
await expect(page.locator('#connection-status')).not.toHaveText('World online');
await route.continue();
}, { times: 1 });
await enter(page, 'Mobile');
await expect(page.getByRole('button', { name: 'Move north' })).toBeVisible();
const before = await page.evaluate(() => (window as any).__aeternalis.snapshot.self.entity.position.z);