From 745206a908738c7533d9a59dd48e89069891b42c Mon Sep 17 00:00:00 2001 From: Alison Joseph Date: Mon, 7 Oct 2024 15:28:45 -0500 Subject: [PATCH 1/3] test(togglesmallskeleton): add test coverage --- .../ToggleSmall/ToggleSmall.skeleton-test.js | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js diff --git a/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js b/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js new file mode 100644 index 000000000000..d3b49cd01278 --- /dev/null +++ b/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js @@ -0,0 +1,33 @@ +/** + * Copyright IBM Corp. 2016, 2023 + * + * This source code is licensed under the Apache-2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from 'react'; +import { ToggleSmallSkeleton } from './ToggleSmall.Skeleton'; +import { render } from '@testing-library/react'; + +describe('ToggleSmallSkeleton', () => { + it('should support a custom `className` prop on the outermost element', () => { + const { container } = render( + + ); + expect(container.firstChild).toHaveClass('test'); + }); + + it('should spread additional props on the outermost element', () => { + const { container } = render( + + ); + expect(container.firstChild).toHaveAttribute('data-testid', 'test'); + }); + + it('should render the `labelText` prop correctly', () => { + const { getByText } = render( + + ); + expect(getByText('Toggle Label')).toBeInTheDocument(); + }); +}); From ba9cec88623b70eaefaceba3b5322f330315bc5e Mon Sep 17 00:00:00 2001 From: Alison Joseph Date: Mon, 7 Oct 2024 15:31:39 -0500 Subject: [PATCH 2/3] chore: fix copyright date --- packages/react/src/components/Toggle/Toggle.Skeleton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/Toggle/Toggle.Skeleton.tsx b/packages/react/src/components/Toggle/Toggle.Skeleton.tsx index 65cc1c2cf6a9..4f668c4888b0 100644 --- a/packages/react/src/components/Toggle/Toggle.Skeleton.tsx +++ b/packages/react/src/components/Toggle/Toggle.Skeleton.tsx @@ -1,5 +1,5 @@ /** - * Copyright IBM Corp. 2016, 2023 + * Copyright IBM Corp. 2016, 2024 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. From 86e631081b9433faa24c7ef0d07556fe90de6c48 Mon Sep 17 00:00:00 2001 From: Alison Joseph Date: Mon, 7 Oct 2024 15:32:06 -0500 Subject: [PATCH 3/3] chore: fix date --- packages/react/src/components/Toggle/Toggle.Skeleton.tsx | 2 +- .../src/components/ToggleSmall/ToggleSmall.skeleton-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/Toggle/Toggle.Skeleton.tsx b/packages/react/src/components/Toggle/Toggle.Skeleton.tsx index 4f668c4888b0..65cc1c2cf6a9 100644 --- a/packages/react/src/components/Toggle/Toggle.Skeleton.tsx +++ b/packages/react/src/components/Toggle/Toggle.Skeleton.tsx @@ -1,5 +1,5 @@ /** - * Copyright IBM Corp. 2016, 2024 + * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. diff --git a/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js b/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js index d3b49cd01278..7f704771c777 100644 --- a/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js +++ b/packages/react/src/components/ToggleSmall/ToggleSmall.skeleton-test.js @@ -1,5 +1,5 @@ /** - * Copyright IBM Corp. 2016, 2023 + * Copyright IBM Corp. 2016, 2024 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree.