test(e2e): add solo modifier indicator smoke guard
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
3d49cd2792
commit
396051f5c0
2 changed files with 58 additions and 1 deletions
|
|
@ -35,6 +35,49 @@ test.describe('Solo-play smoke (T2 preview tests)', () => {
|
|||
await expect(page.locator('[data-square="e2"] [data-piece]')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('solo play with modifier profile renders modifier-indicator dots', async ({ page }) => {
|
||||
const LIBRARY_KEY = 'houserules:modifier-profiles:v1';
|
||||
const entry = {
|
||||
id: 'solo-smoke-indicator',
|
||||
name: 'Solo Smoke Indicator',
|
||||
profile: {
|
||||
id: 'solo-smoke-indicator',
|
||||
name: 'Solo Smoke Indicator',
|
||||
description: '',
|
||||
layoutId: 'classic',
|
||||
perType: [
|
||||
{ kind: 'hp-bonus', pieceType: 'pawn', color: 'both', value: 1 },
|
||||
],
|
||||
perInstance: [],
|
||||
version: 1,
|
||||
source: 'custom',
|
||||
},
|
||||
starred: false,
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
|
||||
await page.goto('/');
|
||||
await page.evaluate(
|
||||
({ key, e }) => localStorage.setItem(key, JSON.stringify([e])),
|
||||
{ key: LIBRARY_KEY, e: entry },
|
||||
);
|
||||
await page.reload();
|
||||
|
||||
const picker = page.getByTestId('profile-picker');
|
||||
if (!(await picker.isVisible())) {
|
||||
await page.locator('[data-action="open-rules-drawer"]').click();
|
||||
}
|
||||
await expect(picker).toBeVisible();
|
||||
await picker.selectOption('solo-smoke-indicator');
|
||||
|
||||
await page.locator('[data-action="play-solo"]').click();
|
||||
await page.waitForURL('**/game', { timeout: 5000 });
|
||||
|
||||
await expect(page.locator('[data-testid^="modifier-indicator-"]').first()).toBeVisible({
|
||||
timeout: 3000,
|
||||
});
|
||||
});
|
||||
|
||||
test('can play multiple moves in sequence (4-ply)', async ({ page }) => {
|
||||
await page.locator('[data-action="play-solo"]').click();
|
||||
await page.waitForURL('**/game');
|
||||
|
|
@ -167,4 +210,3 @@ test.describe('Solo-play smoke (T2 preview tests)', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue