Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): update test files to align with recent component changes

Steven Enamakel4e45bb574c75
diff --git a/app/src/components/feedback/FeedbackFilterSelect.test.tsx b/app/src/components/feedback/FeedbackFilterSelect.test.tsx
index 710c3ce168..b8e002da54 100644
--- a/app/src/components/feedback/FeedbackFilterSelect.test.tsx
+++ b/app/src/components/feedback/FeedbackFilterSelect.test.tsx
@@ -59,7 +59,7 @@ describe('<FeedbackFilterSelect />', () => {
expect(onChange).not.toHaveBeenCalled();
});
- it('opens on ArrowDown and marks the current selection with aria-selected', () => {
+ it('opens on ArrowDown and marks the current selection as checked', () => {
render(
<FeedbackFilterSelect
value="feature"
@@ -73,9 +73,13 @@ describe('<FeedbackFilterSelect />', () => {
fireEvent.keyDown(trigger, { key: 'ArrowDown' });
expect(trigger).toHaveAttribute('aria-expanded', 'true');
+ // `data-state` is Radix's is-this-the-selected-value signal for an item;
+ // `aria-selected` is `isSelected && isFocused` (roving DOM focus), which
+ // jsdom's layout-less focus handling makes unreliable to assert here —
+ // see the "Keyboard only" note in ui/Select.test.tsx for the same caveat.
const selected = screen.getByRole('option', { name: 'Feature' });
- expect(selected).toHaveAttribute('aria-selected', 'true');
- expect(screen.getByRole('option', { name: 'Bug' })).toHaveAttribute('aria-selected', 'false');
+ expect(selected).toHaveAttribute('data-state', 'checked');
+ expect(screen.getByRole('option', { name: 'Bug' })).toHaveAttribute('data-state', 'unchecked');
});
it('commits the highlighted option with Enter', () => {
diff --git a/app/src/pages/onboarding/steps/ApiKeysStep.test.tsx b/app/src/pages/onboarding/steps/ApiKeysStep.test.tsx
index aef158d134..540da643f9 100644
--- a/app/src/pages/onboarding/steps/ApiKeysStep.test.tsx
+++ b/app/src/pages/onboarding/steps/ApiKeysStep.test.tsx
@@ -17,8 +17,10 @@ describe('Onboarding ApiKeysStep', () => {
const separators = document.querySelectorAll('[data-slot="separator"]');
expect(separators).toHaveLength(2);
separators.forEach(separator => {
- expect(separator).toHaveAttribute('aria-hidden', 'true');
- expect(separator).not.toHaveAttribute('role', 'separator');
+ // Decorative (the default): Radix renders `role="none"` rather than
+ // `role="separator"`, keeping it out of the a11y tree the same way the
+ // hand-rolled `aria-hidden` div it replaced did.
+ expect(separator).toHaveAttribute('role', 'none');
});
});
});