await user.click(notDefaultQualityGate);
- const projectSelectList = screen.getByRole('group');
// by default it shows "selected" values
- expect(within(projectSelectList).getAllByRole('button')).toHaveLength(3);
expect(screen.getAllByRole('checkbox')).toHaveLength(2);
// change tabs to show deselected projects
- await user.click(
- within(projectSelectList).getByRole('button', { name: 'quality_gates.projects.without' })
- );
+ await user.click(screen.getByRole('button', { name: 'quality_gates.projects.without' }));
expect(screen.getAllByRole('checkbox')).toHaveLength(2);
// change tabs to show all projects
- await user.click(
- within(projectSelectList).getByRole('button', { name: 'quality_gates.projects.all' })
- );
+ await user.click(screen.getByRole('button', { name: 'quality_gates.projects.all' }));
expect(screen.getAllByRole('checkbox')).toHaveLength(4);
});
await user.click(notDefaultQualityGate);
- const projectSelectList = screen.getByRole('group');
const checkedProjects = screen.getAllByRole('checkbox')[0];
expect(screen.getAllByRole('checkbox')).toHaveLength(2);
await user.click(checkedProjects);
expect(screen.getAllByRole('checkbox')).toHaveLength(1);
// change tabs to show deselected projects
- await user.click(within(projectSelectList).getAllByRole('button')[1]);
+ await user.click(screen.getByRole('button', { name: 'quality_gates.projects.without' }));
const uncheckedProjects = screen.getAllByRole('checkbox')[0];
expect(screen.getAllByRole('checkbox')).toHaveLength(3);
const { disabled, label, options, value } = props;
return (
- <ul aria-label={label} role="group" className="button-toggle">
+ <ul aria-label={label} className="button-toggle">
{options.map((option) => (
<li key={option.value.toString()}>
<Button