mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
We only supported fetching the default httpd port (8080). This commit removes navigation to `radicle.local` which represents `0.0.0.0:8080`, and prepares the app for defining custom port. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { searchPlaceholder } from "@app/lib/shared";
|
|
import { test, expect } from "@tests/support/fixtures.js";
|
|
|
|
test("global hotkeys", async ({ page }) => {
|
|
await page.goto("/");
|
|
await page.locator("body").press(`/`);
|
|
await page.keyboard.type("searchquery");
|
|
|
|
// Keyboard hint shows up in the search bar.
|
|
{
|
|
await expect(page.getByText("⏎")).toBeVisible();
|
|
await expect(page.getByPlaceholder(searchPlaceholder)).toHaveValue(
|
|
"searchquery",
|
|
);
|
|
}
|
|
|
|
// Other hotkeys don't trigger while input is focussed.
|
|
{
|
|
await page.keyboard.type("?");
|
|
await expect(page.getByPlaceholder(searchPlaceholder)).toHaveValue(
|
|
"searchquery?",
|
|
);
|
|
await expect(page.getByText("Keyboard shortcuts")).not.toBeVisible();
|
|
}
|
|
|
|
// Hitting `Esc` defocuses the input.
|
|
{
|
|
await page.locator("body").press("Escape");
|
|
await expect(page.getByPlaceholder(searchPlaceholder)).toHaveValue(
|
|
"searchquery?",
|
|
);
|
|
await expect(page.getByText("⏎")).toBeHidden();
|
|
await expect(page.getByPlaceholder(searchPlaceholder)).not.toBeFocused();
|
|
}
|
|
});
|