import { expect, type Page } from '@playwright/test';

/** Dashboard omnibox (desktop placeholder copy changed with i18n refresh). */
export function dashboardSearchInput(page: Page) {
  return page.getByRole('textbox', { name: 'Search people, servers, and invites' });
}

export async function expectDashboardReady(page: Page, timeout = 30_000): Promise<void> {
  await expect(page).toHaveURL(/\/dashboard/, { timeout });
  await expect(dashboardSearchInput(page)).toBeVisible({ timeout });
}
