mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: use findByRole in ProviderWithUserKeysOnly storybook to avoid race condition (#24367)
This commit is contained in:
+2
-2
@@ -645,10 +645,10 @@ export const ProviderWithUserKeysOnly: Story = {
|
||||
const body = within(canvasElement.ownerDocument.body);
|
||||
await userEvent.click(await body.findByRole("button", { name: /Google/i }));
|
||||
await expect(
|
||||
body.getByRole("switch", { name: "Central API key" }),
|
||||
await body.findByRole("switch", { name: "Central API key" }),
|
||||
).not.toBeChecked();
|
||||
await expect(
|
||||
body.getByRole("switch", { name: "Allow user API keys" }),
|
||||
await body.findByRole("switch", { name: "Allow user API keys" }),
|
||||
).toBeChecked();
|
||||
expect(body.queryByLabelText(/^API Key$/i)).not.toBeInTheDocument();
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user