import userEvent from '@testing-library/user-event';
import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup';
import selectEvent from 'react-select-event';
-import { byLabelText, byRole, byText } from 'testing-library-selector';
+import { byRole, byText } from 'testing-library-selector';
import { getMyProjects, getScannableProjects } from '../../../api/components';
import NotificationsMock from '../../../api/mocks/NotificationsMock';
import UserTokensMock from '../../../api/mocks/UserTokensMock';
title: byRole('button', { name: 'my_profile.per_project_notifications.add' }),
addButton: byRole('button', { name: 'my_profile.per_project_notifications.add' }),
addModalButton: byRole('button', { name: 'add_verb' }),
- searchInput: byLabelText('search_verb', { selector: 'input' }),
+ searchInput: byRole('searchbox', { name: 'search.placeholder' }),
sonarQubeProject: byRole('heading', { name: 'SonarQube' }),
checkbox: (type: NotificationProjectType) =>
byRole('checkbox', {
await user.click(
screen.getByRole('button', { name: 'my_profile.per_project_notifications.add' })
);
- expect(await screen.findByLabelText('search_verb', { selector: 'input' })).toBeInTheDocument();
+ expect(screen.getByLabelText('search.placeholder', { selector: 'input' })).toBeInTheDocument();
await user.keyboard('sonarqube');
await user.click(screen.getByText('SonarQube'));
});
const inputSearch = screen.getByRole('searchbox', {
- name: 'search_verb',
+ name: 'onboarding.create_project.search_repositories_by_name',
});
await user.click(inputSearch);
await user.keyboard('search');
);
const inputSearch = screen.getByRole('searchbox', {
- name: 'search_verb',
+ name: 'onboarding.create_project.search_prompt',
});
await user.click(inputSearch);
await user.keyboard('search');
await selectEvent.select(ui.organizationSelector.get(), [/org-1/]);
const inputSearch = screen.getByRole('searchbox', {
- name: 'search_verb',
+ name: 'onboarding.create_project.search_repositories',
});
await user.click(inputSearch);
await user.keyboard('search');
});
const inputSearch = screen.getByRole('searchbox', {
- name: 'search_verb',
+ name: 'onboarding.create_project.search_prompt',
});
await user.click(inputSearch);
await user.keyboard('sea');
name: `issue.assign.unassigned_click_to_assign`,
})
);
- expect(screen.getByRole('searchbox', { name: 'search_verb' })).toBeInTheDocument();
+ expect(screen.getByRole('searchbox', { name: 'search.search_for_users' })).toBeInTheDocument();
- await user.click(screen.getByRole('searchbox', { name: 'search_verb' }));
+ await user.click(screen.getByRole('searchbox', { name: 'search.search_for_users' }));
await user.keyboard('luke');
expect(screen.getByText('Skywalker')).toBeInTheDocument();
await user.keyboard('{ArrowUp}{enter}');
// changing tags
expect(screen.getByText('issue.no_tag')).toBeInTheDocument();
await user.click(screen.getByText('issue.no_tag'));
- expect(screen.getByRole('searchbox', { name: 'search_verb' })).toBeInTheDocument();
+ expect(screen.getByRole('searchbox', { name: 'search.search_for_tags' })).toBeInTheDocument();
expect(screen.getByText('android')).toBeInTheDocument();
expect(screen.getByText('accessibility')).toBeInTheDocument();
await user.click(screen.getByText('accessibility'));
expect(screen.getByTitle('android')).toBeInTheDocument();
- await user.click(screen.getByRole('searchbox', { name: 'search_verb' }));
+ await user.click(screen.getByRole('searchbox', { name: 'search.search_for_tags' }));
await user.keyboard('addNewTag');
expect(
screen.getByRole('checkbox', { name: 'create_new_element: addnewtag' })
// open tags popup on key press 't'
await user.keyboard('t');
- expect(screen.getByRole('searchbox', { name: 'search_verb' })).toBeInTheDocument();
+ expect(screen.getByRole('searchbox', { name: 'search.search_for_tags' })).toBeInTheDocument();
expect(screen.getByText('android')).toBeInTheDocument();
expect(screen.getByText('accessibility')).toBeInTheDocument();
// closing tags popup
// open assign popup on key press 'a'
await user.keyboard('a');
- expect(screen.getByRole('searchbox', { name: 'search_verb' })).toBeInTheDocument();
+ expect(screen.getByRole('searchbox', { name: 'search.search_for_tags' })).toBeInTheDocument();
});
it('should not open the actions popup using keyboard shortcut when keyboard shortcut flag is disabled', async () => {
const ui = {
checkbox: (name: string) => byRole('checkbox', { name }),
- search: byRole('searchbox', { name: 'search_verb' }),
+ search: byRole('searchbox', { name: 'search' }),
noResult: byText('no_results_for_x.notfound'),
};
onSearch={onSearch}
onSelect={onSelect}
onUnselect={onUnselect}
- placeholder=""
+ placeholder="search"
{...props}
/>
);
}
>
<input
- aria-label={translate('search_verb')}
+ aria-label={this.props.placeholder}
autoComplete="off"
autoFocus={this.props.autoFocus}
className={inputClassName}
title=""
>
<input
- aria-label="search_verb"
+ aria-label="placeholder"
autoComplete="off"
className="search-box-input"
maxLength={150}