UNPKG

@payfit/unity-components

Version:

12 lines (11 loc) 600 B
import { screen as e, userEvent as t, within as n } from "storybook/test"; //#region src/components/select-field/test-utils.ts var r = (r) => ({ selectOption: async ({ labelText: i, optionName: a, container: o = r.canvasElement }) => { await r.step(`Select option "${a}" in "${i}"`, async () => { let r = n(o).getByLabelText(i, { exact: !1 }); if (!r) throw Error(`Select not found for label ${i}`); await t.click(r, { delay: 100 }), await t.click(e.getByRole("option", { name: a }), { delay: 100 }), await t.tab({ delay: 100 }); }); } }); //#endregion export { r as getTestingUtilsSelect };