Skip to content

Commit 0cf0110

Browse files
committed
add testid to bulk update button and fix bulk update tests
1 parent ed6399a commit 0cf0110

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

site/src/pages/WorkspacesPage/WorkspacesPage.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe("WorkspacesPage", () => {
107107
}
108108

109109
await user.click(screen.getByRole("button", { name: /bulk actions/i }));
110-
const updateButton = await screen.findByText(/update/i);
110+
const updateButton = await screen.findByTestId("bulk-action-update");
111111
await user.click(updateButton);
112112

113113
// One click: no running workspaces warning, no dormant workspaces warning.
@@ -146,7 +146,7 @@ describe("WorkspacesPage", () => {
146146
}
147147

148148
await user.click(screen.getByRole("button", { name: /bulk actions/i }));
149-
const updateButton = await screen.findByText(/update/i);
149+
const updateButton = await screen.findByTestId("bulk-action-update");
150150
await user.click(updateButton);
151151

152152
// Two clicks: 1 running workspace, no dormant workspaces warning.
@@ -184,7 +184,7 @@ describe("WorkspacesPage", () => {
184184
}
185185

186186
await user.click(screen.getByRole("button", { name: /bulk actions/i }));
187-
const updateButton = await screen.findByText(/update/i);
187+
const updateButton = await screen.findByTestId("bulk-action-update");
188188
await user.click(updateButton);
189189

190190
// Two clicks: no running workspaces warning, 1 dormant workspace.
@@ -224,7 +224,7 @@ describe("WorkspacesPage", () => {
224224
}
225225

226226
await user.click(screen.getByRole("button", { name: /bulk actions/i }));
227-
const updateButton = await screen.findByText(/update/i);
227+
const updateButton = await screen.findByTestId("bulk-action-update");
228228
await user.click(updateButton);
229229

230230
// Three clicks: 1 running workspace, 1 dormant workspace.

site/src/pages/WorkspacesPage/WorkspacesPageView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({
171171
</DropdownMenuItem>
172172
<DropdownMenuSeparator />
173173
<DropdownMenuItem onClick={onUpdateAll}>
174-
<CloudIcon className="size-icon-sm" /> Update&hellip;
174+
<CloudIcon
175+
className="size-icon-sm"
176+
data-testid="bulk-action-update"
177+
/>{" "}
178+
Update&hellip;
175179
</DropdownMenuItem>
176180
<DropdownMenuItem
177181
className="text-content-destructive focus:text-content-destructive"

0 commit comments

Comments
 (0)