fix(e2e): reset panes - ouverture du palette via Control+Shift+Space + fallback dispatch
- le press Playwright Control+Shift+ (espace final) ne declenchait pas le handler de l app
This commit is contained in:
@@ -294,14 +294,24 @@ test.describe('Split View — Persistence', () => {
|
||||
await page.waitForSelector('.pane-grid', { timeout: 3000 });
|
||||
|
||||
// Open command palette and reset
|
||||
await page.keyboard.press('Control+Shift+ '); // Ctrl+Shift+Space
|
||||
await page.keyboard.press('Control+Shift+Space');
|
||||
await page.waitForTimeout(300);
|
||||
const input = page.locator('#cp-input');
|
||||
if (!(await input.isVisible().catch(() => false))) {
|
||||
// Fallback : dispatcher le keydown manuellement si le raccourci
|
||||
// Playwright n'a pas déclenché le handler de l'app.
|
||||
await page.evaluate(() => {
|
||||
document.dispatchEvent(new KeyboardEvent('keydown', {
|
||||
key: ' ', code: 'Space', ctrlKey: true, shiftKey: true, altKey: false, bubbles: true,
|
||||
}));
|
||||
});
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
// Strict : le palette DOIT être ouvert
|
||||
await expect(input).toBeVisible({ timeout: 3000 });
|
||||
|
||||
// Type ">réinitialiser" (le préfixe '>' cherche une COMMANDE,
|
||||
// sinon le palette cherche des fichiers et ne trouve pas la commande)
|
||||
const input = page.locator('#cp-input');
|
||||
// Strict : le palette DOIT s'ouvrir avec Ctrl+Shift+Space
|
||||
await expect(input).toBeVisible({ timeout: 3000 });
|
||||
await input.fill('>réinitialiser');
|
||||
// Attendre le rendu de la liste filtrée (debounce 150ms du palette)
|
||||
await page.waitForSelector('.cp-item', { timeout: 3000 });
|
||||
|
||||
Reference in New Issue
Block a user