test(ui): cover profile rule keyboard toggles
This commit is contained in:
parent
4566e9f675
commit
a65d7261ca
@ -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 />);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user