feat(vela): start mocked response flow after push-to-talk commit

This commit is contained in:
2026-04-08 21:20:17 +02:00
parent 98bcc543f5
commit 28712443cc
8 changed files with 284 additions and 25 deletions

View File

@@ -105,6 +105,7 @@ test('voice session shell supports a placeholder mic-control cycle before anothe
await expect(page.getByTestId('user-transcript')).toHaveText(
'[mocked final] Placeholder push-to-talk transcript completed from 1 appended chunk.'
);
await expect(page.getByTestId('assistant-response')).toHaveText(MOCKED_ASSISTANT_RESPONSE);
await expect(page.getByTestId('partial-transcript')).toHaveText('none');
await expect(page.getByTestId('gateway-session-state')).toHaveText('idle');
await expect(page.getByTestId('mocked-turn-button')).toBeEnabled();
@@ -114,3 +115,34 @@ test('voice session shell supports a placeholder mic-control cycle before anothe
await expect(page.getByTestId('assistant-response')).toHaveText(MOCKED_ASSISTANT_RESPONSE);
await expect(page.getByTestId('mocked-turn-status')).toHaveText('idle');
});
test('voice session shell can cancel a push-to-talk mocked response and start another turn', async ({ page }) => {
await page.goto('/');
await expect(page.getByTestId('hydration-status')).toHaveText('ready');
await page.getByTestId('connect-button').click();
await expect(page.getByTestId('connection-state')).toHaveText('connected');
await page.getByTestId('mic-control-button').dispatchEvent('mousedown');
await expect(page.getByTestId('gateway-session-state')).toHaveText('listening');
await page.getByTestId('mic-control-button').dispatchEvent('mouseup');
await expect(page.getByTestId('user-transcript')).toHaveText(
'[mocked final] Placeholder push-to-talk transcript completed from 1 appended chunk.'
);
await expect(page.getByTestId('cancel-turn-button')).toBeEnabled();
await expect(page.getByTestId('assistant-response')).toContainText('[mocked assistant]');
await page.getByTestId('cancel-turn-button').click();
await expect(page.getByTestId('gateway-session-state')).toHaveText('idle');
await expect(page.getByTestId('mocked-turn-status')).toHaveText('idle');
await expect(page.getByTestId('user-transcript')).toHaveText(
'[mocked final] Placeholder push-to-talk transcript completed from 1 appended chunk.'
);
await expect(page.getByTestId('assistant-response')).toContainText('[mocked assistant]');
await expect(page.getByTestId('mocked-turn-button')).toBeEnabled();
await page.getByTestId('mocked-turn-button').click();
await expect(page.getByTestId('assistant-response')).toHaveText(MOCKED_ASSISTANT_RESPONSE);
await expect(page.getByTestId('mocked-turn-status')).toHaveText('idle');
});