Skip to content

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

fix(settings): correct migration panel test to use proper mock data

Steven Enamakela6c9065efdae
diff --git a/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx b/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx
index 23240109a1..2161d36738 100644
--- a/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx
+++ b/app/src/components/settings/panels/__tests__/MigrationPanel.test.tsx
@@ -58,11 +58,12 @@ describe('MigrationPanel (#1440)', () => {
it('renders OpenClaw as the default vendor and Hermes as selectable', () => {
renderWithProviders(<MigrationPanel />);
- const select = screen.getByTestId('migration-vendor-select') as HTMLSelectElement;
- expect(select.value).toBe('openclaw');
- const hermesOption = Array.from(select.options).find(o => o.value === 'hermes');
- expect(hermesOption).toBeDefined();
- expect(hermesOption?.disabled).toBe(false);
+ expect(screen.getByTestId('migration-vendor-select')).toHaveAttribute('role', 'radiogroup');
+ const openclawOption = screen.getByTestId('migration-vendor-option-openclaw');
+ const hermesOption = screen.getByTestId('migration-vendor-option-hermes');
+ expect(openclawOption).toHaveAttribute('aria-checked', 'true');
+ expect(hermesOption).toHaveAttribute('aria-checked', 'false');
+ expect(hermesOption).not.toBeDisabled();
expect(screen.getByTestId('migration-apply-button')).toBeDisabled();
});
@@ -76,8 +77,7 @@ describe('MigrationPanel (#1440)', () => {
});
renderWithProviders(<MigrationPanel />);
- const select = screen.getByTestId('migration-vendor-select') as HTMLSelectElement;
- fireEvent.change(select, { target: { value: 'hermes' } });
+ fireEvent.click(screen.getByTestId('migration-vendor-option-hermes'));
fireEvent.click(screen.getByTestId('migration-preview-button'));
await waitFor(() => expect(screen.getByTestId('migration-report-preview')).toBeInTheDocument());