fix(search): Fix broken tests

Signed-off-by: Carlos Esteban Lopez <lcarlosesteb@vmware.com>
This commit is contained in:
Carlos Esteban Lopez
2023-04-19 12:33:08 -05:00
committed by Carlos Lopez
parent 87efd07490
commit 9e0f486ac2
2 changed files with 19 additions and 7 deletions
@@ -133,7 +133,9 @@ describe('SearchBar', () => {
);
await waitFor(() => {
expect(screen.getByRole('textbox', { name: 'Search' })).toHaveValue(term);
expect(
screen.getByRole('textbox', { name: 'Search in Mock title' }),
).toHaveValue(term);
});
});
@@ -154,7 +156,9 @@ describe('SearchBar', () => {
</TestApiProvider>,
);
const textbox = screen.getByRole('textbox', { name: 'Search' });
const textbox = screen.getByRole('textbox', {
name: 'Search in Mock title',
});
const value = 'value';
@@ -191,7 +195,9 @@ describe('SearchBar', () => {
</TestApiProvider>,
);
const textbox = screen.getByRole('textbox', { name: 'Search' });
const textbox = screen.getByRole('textbox', {
name: 'Search in Mock title',
});
await waitFor(() => {
expect(textbox).toHaveValue(term);
@@ -249,7 +255,9 @@ describe('SearchBar', () => {
</TestApiProvider>,
);
const textbox = await screen.findByRole('textbox', { name: 'Search' });
const textbox = await screen.findByRole('textbox', {
name: 'Search in Mock title',
});
const value = 'value';
@@ -293,7 +301,9 @@ describe('SearchBar', () => {
</TestApiProvider>,
);
const textbox = await screen.findByRole('textbox', { name: 'Search' });
const textbox = await screen.findByRole('textbox', {
name: 'Search in Mock title',
});
const value = 'value';
@@ -343,7 +353,9 @@ describe('SearchBar', () => {
</TestApiProvider>,
);
const textbox = await screen.findByRole('textbox', { name: 'Search' });
const textbox = await screen.findByRole('textbox', {
name: 'Search in Mock title',
});
let value = 'value';
@@ -166,6 +166,6 @@ describe('SearchModal', () => {
},
);
expect(screen.getByLabelText('Search')).toHaveFocus();
expect(screen.getByLabelText('Search in Mock app')).toHaveFocus();
});
});