function getPageObject(user: UserEvent) {
const ui = {
componentName: (name: string) => byText(name),
- childComponent: (name: string | RegExp) => byRole('cell', { name, exact: false }),
- searchResult: (name: string | RegExp) => byRole('link', { name, exact: false }),
+ childComponent: (name: string | RegExp) => byRole('cell', { name }),
+ searchResult: (name: string | RegExp) => byRole('link', { name }),
componentIsEmptyTxt: (qualifier: ComponentQualifier) =>
byText(`code_viewer.no_source_code_displayed_due_to_empty_analysis.${qualifier}`),
searchInput: byRole('searchbox'),
expect(screen.getByRole('link', { name: 'simpleRuleId' })).toBeInTheDocument();
// The "Where is the issue" tab should be selected by default. Check its content
- expect(screen.getAllByRole('button', { name: 'Issue on file', exact: false })).toHaveLength(
- 2,
- ); // there will be 2 buttons one in concise issue and other in code viewer
+ expect(screen.getAllByRole('button', { name: 'Issue on file' })).toHaveLength(2); // there will be 2 buttons one in concise issue and other in code viewer
expect(
screen.getByRole('row', {
name: '2 * SonarQube',
issueItem7: byRole('region', { name: 'Issue with tags' }),
issueItem8: byRole('region', { name: 'Issue on page 2' }),
issueItem9: byRole('region', { name: 'Issue inside folderA' }),
- projectIssueItem6: byRole('button', { name: 'Second issue', exact: false }),
+ projectIssueItem6: byRole('button', { name: 'Second issue' }),
conciseIssueTotal: byTestId('page-counter-total'),
conciseIssueItem2: byTestId('issues-nav-bar').byRole('button', { name: 'Fix that' }),
expect(heading).toBeInTheDocument();
// No OAuth providers, login form display by default.
- expect(
- screen.queryByRole('link', { name: 'login.login_with_x', exact: false }),
- ).not.toBeInTheDocument();
+ expect(screen.queryByRole('link', { name: 'login.login_with_x' })).not.toBeInTheDocument();
expect(screen.getByLabelText('login')).toBeInTheDocument();
});