From 71aa5edf5d3bb7da74299c9b87f348da6a3fbc7c Mon Sep 17 00:00:00 2001 From: Myrto Kontouli Date: Wed, 26 Jul 2023 21:09:57 +0100 Subject: [PATCH] refactor: rename OptionallyVisuallyHiddenContainer to OptionalVisuallyHiddenWrapper to match naming to CSSWrapper and make more grammatical sense --- .../data-table/DataTableGlobalFilter.tsx | 6 ++-- .../OptionalVisuallyHiddenWrapper.test.tsx | 30 +++++++++++++++++++ .../OptionalVisuallyHiddenWrapper.tsx} | 4 ++- ...tionalVisuallyHiddenWrapper.test.tsx.snap} | 4 +-- .../optional-visually-hidden-wrapper/index.ts | 1 + ...OptionallyVisuallyHiddenContainer.test.tsx | 26 ---------------- .../index.ts | 1 - 7 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 lib/src/utilities/optional-visually-hidden-wrapper/OptionalVisuallyHiddenWrapper.test.tsx rename lib/src/utilities/{optionally-visually-hidden-container/OptionallyVisuallyHiddenContainer.tsx => optional-visually-hidden-wrapper/OptionalVisuallyHiddenWrapper.tsx} (76%) rename lib/src/utilities/{optionally-visually-hidden-container/__snapshots__/OptionallyVisuallyHiddenContainer.test.tsx.snap => optional-visually-hidden-wrapper/__snapshots__/OptionalVisuallyHiddenWrapper.test.tsx.snap} (69%) create mode 100644 lib/src/utilities/optional-visually-hidden-wrapper/index.ts delete mode 100644 lib/src/utilities/optionally-visually-hidden-container/OptionallyVisuallyHiddenContainer.test.tsx delete mode 100644 lib/src/utilities/optionally-visually-hidden-container/index.ts diff --git a/lib/src/components/data-table/DataTableGlobalFilter.tsx b/lib/src/components/data-table/DataTableGlobalFilter.tsx index 4706e0d8c..7e6f1ff39 100644 --- a/lib/src/components/data-table/DataTableGlobalFilter.tsx +++ b/lib/src/components/data-table/DataTableGlobalFilter.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { debounce } from 'throttle-debounce' -import { OptionallyVisuallyHiddenContainer } from '../../utilities/optionally-visually-hidden-container' +import { OptionalVisuallyHiddenWrapper } from '../../utilities/optional-visually-hidden-wrapper' import { Label } from '../label' import { SearchInput } from '../search-input' import { AsyncDataState } from './DataTable.types' @@ -43,11 +43,11 @@ export const DataTableGlobalFilter: React.FC = ({ return ( <> - + { + return ( + +

hello

+
+ ) +} + +describe('OptionalVisuallyHidden component', () => { + it('renders hidden content', async () => { + const { container } = render( +