- Notifications
You must be signed in to change notification settings - Fork1.1k
fix: clear prompt after task creation#20344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -114,6 +114,11 @@ export const OnSuccess: Story = { | ||
| const successMessage = await body.findByText(/task created/i); | ||
| expect(successMessage).toBeInTheDocument(); | ||
| }); | ||
| await step("Clears prompt", async () => { | ||
| const prompt = await canvas.findByLabelText(/prompt/i); | ||
| expect(prompt).toHaveValue(""); | ||
| }); | ||
Comment on lines +118 to +121 Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Are we able to use a role selector here? Maybe something like: constprompt=awaitcanvas.findByRole("textbox",{name:/prompt/i,}); ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think it’s more accessible in this case to rely on the label, since that’s what both screen readers and users interact with. For example, when we get an element by role, we’re not checking whether it actually has an accessible label. By getting an element by label, I don’t really care what type of element it is, because I can still perform the action I need. Makes sense? | ||
| }, | ||
| }; | ||
Uh oh!
There was an error while loading.Please reload this page.