Skip to content

Commit

Permalink
UIIN-2493 Fix tests for Inventory search and browse
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanDenis committed Oct 30, 2023
1 parent 04e5a48 commit ab8a210
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/InstancesList/InstancesList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ describe('InstancesList', () => {
it('should have query in search input', () => {
renderInstancesList({ segment: 'instances' });

fireEvent.change(screen.getByRole('searchbox', { name: 'Search' }), { target: { value: 'search query' } });
fireEvent.change(screen.getByRole('textbox', { name: 'Search' }), { target: { value: 'search query' } });
fireEvent.click(screen.getAllByRole('button', { name: 'Search' })[1]);

expect(screen.getByRole('searchbox', { name: 'Search' })).toHaveValue('search query');
expect(screen.getByRole('textbox', { name: 'Search' })).toHaveValue('search query');
});

describe('when the search option is changed', () => {
Expand Down Expand Up @@ -549,7 +549,7 @@ describe('InstancesList', () => {

await act(async () => fireEvent.change(screen.getByLabelText('Search field index'), { target: { value: qindex } }));

fireEvent.change(screen.getByRole('searchbox', { name: 'Search' }), { target: { value: _query } });
fireEvent.change(screen.getByRole('textbox', { name: 'Search' }), { target: { value: _query } });
fireEvent.click(screen.getAllByRole('button', { name: 'Search' })[1]);

const row = screen.getAllByText('ABA Journal')[0];
Expand Down
2 changes: 1 addition & 1 deletion src/views/BrowseInventory/BrowseInventory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('BrowseInventory', () => {
it('should call "changeSearch" when search query was changed', async () => {
const { container } = renderBrowseInventory();

await act(async () => userEvent.type(screen.getByRole('searchbox'), 'newQuery'));
await act(async () => userEvent.type(screen.getByRole('textbox'), 'newQuery'));
await act(async () => userEvent.click(container.querySelector('[data-test-single-search-form-submit="true"]')));

expect(applySearch).toHaveBeenCalled();
Expand Down

0 comments on commit ab8a210

Please sign in to comment.