Skip to content

Commit 3f838d2

Browse files
gnick18claude
andcommitted
test(4-files): repair 4 failing test suites
FeedbackModal (5 fails): FileDropzone migrated the file input behind a role=button wrapper div; the hidden input had no accessible label, so getByLabelText finds the outer div not the input. Move aria-label from the outer div onto the input so fireEvent.change reaches the onChange handler. Thumbnails render correctly once the input is findable. purchases-page.misc-filter (1 fail): showApprovalFilter = useIsLabMode() === true, but useIsLabMode was not mocked, so the Awaiting-approval chip was filtered out before render. Add useIsLabMode mock returning true -- the suite tests a member in a lab-mode folder, which is the only context where the chip is visible. WorkbenchExperimentsPanel.sharedFilter (1 fail): data-tour-target was stamped on the board-view card wrapper but not on the list-view row. Default view is list, so the section-6.16 cursor-demo anchors were absent. Mirror the labTourTarget logic onto the list row so the cursor demo can find the anchors regardless of view mode. InlineMarkdownEditor.loro: already passing (5/5) -- no changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 646b015 commit 3f838d2

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

frontend/src/app/__tests__/purchases-page.misc-filter.test.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ vi.mock("@/hooks/useAccountType", () => ({
9292
useAccountType: () => "member",
9393
}));
9494

95+
// The awaiting-approval chip renders only in lab mode (showApprovalFilter =
96+
// useIsLabMode() === true). This suite tests the chip in a lab-mode context
97+
// where a member is waiting on the lab head for approval.
98+
vi.mock("@/hooks/useIsLabMode", () => ({
99+
useIsLabMode: () => true,
100+
}));
101+
95102
// Purchases UX fix Bug 3 (2026-05-24): the new banner CTA uses
96103
// `useRouter().push("/lab-overview")`. The misc-filter suite never
97104
// triggers it (account_type is "member"), but the hook still has to

frontend/src/components/ui/FileDropzone.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export default function FileDropzone({
107107
<div
108108
role="button"
109109
tabIndex={disabled ? -1 : 0}
110-
aria-label={ariaLabel}
111110
aria-disabled={disabled || undefined}
112111
// This surface handles the file itself, so opt out of the window-level
113112
// GlobalDropGuard: data-attach-target suppresses its "not supported" toast,
@@ -179,6 +178,7 @@ export default function FileDropzone({
179178
accept={accept}
180179
multiple={multiple}
181180
disabled={disabled}
181+
aria-label={ariaLabel}
182182
className="hidden"
183183
onChange={(e) => {
184184
emit(e.target.files);

frontend/src/components/workbench/WorkbenchExperimentsPanel.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,15 @@ export default function WorkbenchExperimentsPanel({
839839
key={taskKey(t)}
840840
data-beaker-target={`experiment:${taskKey(t)}`}
841841
data-testid="experiment-row"
842+
data-tour-target={
843+
t.is_shared_with_me && t.owner === BEAKERBOT_LAB_USERNAME
844+
? t.shared_permission === "edit"
845+
? "workbench-shared-edit-experiment"
846+
: t.shared_permission === "view"
847+
? "workbench-shared-view-experiment"
848+
: undefined
849+
: undefined
850+
}
842851
onClick={() => setSelectedTask(t)}
843852
onContextMenu={(e) => {
844853
e.preventDefault();

0 commit comments

Comments
 (0)