gradio/js/app/test/load_space.spec.ts
Hannah 44c53d9bde
Fix dropdown refocusing due to <label /> element (#7081)
* Remove extra blur causing refocus bug and add a11y tweaks

* change label to div causing reopen of dropdown

* add changeset

* Tweak label attribute

* fix browser test

* formatting

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-01-22 10:32:27 -08:00

14 lines
502 B
TypeScript

import { test, expect } from "@gradio/tootils";
test("test that the submit and clear buttons in a loaded space work", async ({
page
}) => {
await page.getByLabel("x").click();
await page.getByLabel("Pakistan", { exact: true }).click();
await page.getByRole("button", { name: "Submit" }).click();
await expect(await page.getByLabel("Output")).toHaveValue("Pakistan");
await page.getByRole("button", { name: "Clear" }).click();
await expect(await page.getByLabel("Output")).toHaveValue("");
});