Fix world entry readiness and mobile startup test
This commit is contained in:
+8
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user