Skip to content

Commit

Permalink
fix(tests): update snapshots and search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ariellalgilmore committed Jun 26, 2024
1 parent 1da31de commit 1509652
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ exports[`DataTable behaves as expected selection should render and match snapsho
>
<div
aria-expanded="false"
aria-label="button"
aria-label=""
class="cds--search-magnifier"
role="button"
role=""
tabindex="-1"
>
<svg
Expand Down Expand Up @@ -936,9 +936,9 @@ exports[`DataTable renders as expected - Component API should render and match s
>
<div
aria-expanded="false"
aria-label="button"
aria-label=""
class="cds--search-magnifier"
role="button"
role=""
tabindex="-1"
>
<svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ exports[`TableToolbarSearch renders as expected - Component API should render 1`
>
<div
aria-expanded="false"
aria-label="button"
aria-label=""
class="cds--search-magnifier"
role="button"
role=""
tabindex="-1"
>
<svg
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/components/Search/Search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ describe('Search', () => {
it('should have tabbable input and untabbable button if not expandable', async () => {
render(<Search labelText="test-search" />);

// will have 2 buttons which is the close button and div with a role button
expect(screen.getAllByRole('button').length).toBe(2);
// will have 1 button which is the close button
expect(screen.getAllByRole('button').length).toBe(1);
// search icon not tabbable if not exandable
expect(screen.getByRole('searchbox')).not.toHaveAttribute(
'tabIndex',
'-1'
Expand Down

0 comments on commit 1509652

Please sign in to comment.