mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-26 13:17:15 -05:00
New user search & dialog (#2270)
* From scrims * wip * wip * wip * wip * WIP * wip * wip * wip * wip * wip * import ordering
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { sql } from "kysely";
|
||||
import { type ColumnType, sql } from "kysely";
|
||||
import type { Tables } from "~/db/tables";
|
||||
|
||||
export const COMMON_USER_FIELDS = [
|
||||
@@ -32,3 +32,6 @@ export function unJsonify<T>(value: T) {
|
||||
|
||||
return `\\${value}`;
|
||||
}
|
||||
|
||||
export type JSONColumnTypeNullable<SelectType extends object | null> =
|
||||
ColumnType<SelectType | null, string | null, string | null>;
|
||||
|
||||
@@ -24,12 +24,15 @@ export async function selectUser({
|
||||
userName: string;
|
||||
labelName: string;
|
||||
}) {
|
||||
const combobox = page.getByLabel(labelName);
|
||||
await expect(combobox).not.toBeDisabled();
|
||||
const comboboxButton = page.getByLabel(labelName);
|
||||
const searchInput = page.getByTestId("user-search-input");
|
||||
const option = page.getByTestId("user-search-item").first();
|
||||
|
||||
await combobox.clear();
|
||||
await combobox.fill(userName);
|
||||
await expect(page.getByTestId("combobox-option-0")).toBeVisible();
|
||||
await expect(comboboxButton).not.toBeDisabled();
|
||||
|
||||
await comboboxButton.click();
|
||||
await searchInput.fill(userName);
|
||||
await expect(option).toBeVisible();
|
||||
await page.keyboard.press("Enter");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user