test(ui): cover profile rule keyboard toggles

This commit is contained in:
Saravana Achu Mac 2026-05-09 02:03:10 -07:00
parent 4566e9f675
commit a65d7261ca

View File

@ -178,6 +178,29 @@ describe('TradeProfileManager DOM flow', () => {
});
}, 20000);
it('lets keyboard users toggle strategy rules from the drawer', async () => {
const user = userEvent.setup();
render(<TradeProfileManager />);
await waitFor(() => {
expect(screen.getAllByText('High Risk Scalper').length).toBeGreaterThan(0);
});
await user.click(screen.getByRole('button', { name: /New Profile/i }));
await user.click(screen.getByRole('button', { name: 'Rules' }));
expect(screen.getByText('Fast EMA Period')).toBeInTheDocument();
const trendBiasRule = screen.getByRole('button', { name: /Trend Bias/ });
trendBiasRule.focus();
await user.keyboard('{Enter}');
expect(screen.queryByText('Fast EMA Period')).not.toBeInTheDocument();
await user.keyboard(' ');
expect(screen.getByText('Fast EMA Period')).toBeInTheDocument();
}, 20000);
it('updates activation state, edits profile, and deletes profile', async () => {
const user = userEvent.setup();
render(<TradeProfileManager />);