feat: rework command search (#3109)

This commit is contained in:
David Nguyen
2026-07-23 13:16:44 +09:00
committed by GitHub
parent 54befb5962
commit c02dfaba1a
11 changed files with 2064 additions and 233 deletions
@@ -3,6 +3,9 @@ import { seedUser } from '@documenso/prisma/seed/users';
import { expect, test } from '@playwright/test';
import { apiSignin } from '../fixtures/authentication';
import { openCommandMenu } from '../fixtures/command-menu';
const COMMAND_MENU_PLACEHOLDER = 'Type a command or search...';
test('[COMMAND_MENU]: should see sent documents', async ({ page }) => {
const { user, team } = await seedUser();
@@ -14,9 +17,9 @@ test('[COMMAND_MENU]: should see sent documents', async ({ page }) => {
email: user.email,
});
await page.keyboard.press('Meta+K');
await openCommandMenu(page, COMMAND_MENU_PLACEHOLDER);
await page.getByPlaceholder('Type a command or search...').first().fill(document.title);
await page.getByPlaceholder(COMMAND_MENU_PLACEHOLDER).first().fill(document.title);
await expect(page.getByRole('option', { name: document.title })).toBeVisible();
});
@@ -30,9 +33,9 @@ test('[COMMAND_MENU]: should see received documents', async ({ page }) => {
email: recipient.email,
});
await page.keyboard.press('Meta+K');
await openCommandMenu(page, COMMAND_MENU_PLACEHOLDER);
await page.getByPlaceholder('Type a command or search...').first().fill(document.title);
await page.getByPlaceholder(COMMAND_MENU_PLACEHOLDER).first().fill(document.title);
await expect(page.getByRole('option', { name: document.title })).toBeVisible();
});
@@ -46,8 +49,8 @@ test('[COMMAND_MENU]: should be able to search by recipient', async ({ page }) =
email: user.email,
});
await page.keyboard.press('Meta+K');
await openCommandMenu(page, COMMAND_MENU_PLACEHOLDER);
await page.getByPlaceholder('Type a command or search...').first().fill(recipient.email);
await page.getByPlaceholder(COMMAND_MENU_PLACEHOLDER).first().fill(recipient.email);
await expect(page.getByRole('option', { name: document.title })).toBeVisible();
});