Skip to content

Commit 418bd76

Browse files
committed
fix: fix tests related to autocomplete changes
1 parent bf2284d commit 418bd76

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

site/e2e/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export const createTemplate = async (
266266

267267
// If the organization picker is present on the page, select the default
268268
// organization.
269-
const orgPicker = page.getByLabel("Belongs to *");
269+
const orgPicker = page.getByTestId("organization-autocomplete");
270270
const organizationsEnabled = await orgPicker.isVisible();
271271
if (organizationsEnabled) {
272272
if (orgName !== defaultOrganizationName) {
@@ -1233,7 +1233,7 @@ export async function createUser(
12331233

12341234
// If the organization picker is present on the page, select the default
12351235
// organization.
1236-
const orgPicker = page.getByLabel("Organization *");
1236+
const orgPicker = page.getByTestId("organization-autocomplete");
12371237
const organizationsEnabled = await orgPicker.isVisible();
12381238
if (organizationsEnabled) {
12391239
// The organization picker will be disabled if there is only one option.

site/src/pages/CreateUserPage/CreateUserForm.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export const WithOrganizations: Story = {
6363
},
6464
play: async ({ canvasElement }) => {
6565
const canvas = within(canvasElement);
66-
await userEvent.click(canvas.getByLabelText("Organization *"));
66+
const autocomplete = await canvas.findByTestId("organization-autocomplete");
67+
await userEvent.click(autocomplete);
6768
},
6869
};
6970

0 commit comments

Comments
 (0)