From afbcd24e19458976ef135df906e5c409ed1bd9dd Mon Sep 17 00:00:00 2001 From: gitdallas Date: Mon, 30 Jan 2023 14:41:31 -0600 Subject: [PATCH 1/3] chore(NotificationBadge): remove deprecated isread prop --- .../NotificationBadge/NotificationBadge.tsx | 5 +- .../__tests__/NotificationBadge.test.tsx | 7 -- .../NotificationBadge.test.tsx.snap | 70 +------------------ 3 files changed, 4 insertions(+), 78 deletions(-) diff --git a/packages/react-core/src/components/NotificationBadge/NotificationBadge.tsx b/packages/react-core/src/components/NotificationBadge/NotificationBadge.tsx index 1fdd2a8f613..0bc4f8741d0 100644 --- a/packages/react-core/src/components/NotificationBadge/NotificationBadge.tsx +++ b/packages/react-core/src/components/NotificationBadge/NotificationBadge.tsx @@ -28,16 +28,13 @@ export interface NotificationBadgeProps extends Omit { * notification badge. */ isExpanded?: boolean; - /** @deprecated Use the variant prop instead - Adds styling to the notification badge to indicate it has been read. */ - isRead?: boolean; /** Determines the variant of the notification badge. */ variant?: NotificationBadgeVariant | 'read' | 'unread' | 'attention'; } export const NotificationBadge: React.FunctionComponent = ({ - isRead, children, - variant = isRead ? 'read' : 'unread', + variant, count = 0, attentionIcon = , icon = , diff --git a/packages/react-core/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx b/packages/react-core/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx index 5f11a93a01c..d58920e05f2 100644 --- a/packages/react-core/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +++ b/packages/react-core/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx @@ -2,13 +2,6 @@ import { NotificationBadge } from '../NotificationBadge'; import React from 'react'; import { render, screen } from '@testing-library/react'; -Object.values([true, false]).forEach(isRead => { - test(`${isRead} NotificationBadge`, () => { - const { asFragment } = render(); - expect(asFragment()).toMatchSnapshot(); - }); -}); - Object.values([true, false]).forEach(attentionVariant => { test(`${attentionVariant} NotificationBadge needs attention`, () => { const { asFragment } = render( diff --git a/packages/react-core/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap b/packages/react-core/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap index 4003f37109a..29246d635dc 100644 --- a/packages/react-core/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +++ b/packages/react-core/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap @@ -6,7 +6,7 @@ exports[`NotificationBadge count 1`] = ` aria-disabled="false" aria-expanded="false" class="pf-c-button pf-m-plain" - data-ouia-component-id="OUIA-Generated-Button-plain-5" + data-ouia-component-id="OUIA-Generated-Button-plain-3" data-ouia-component-type="PF4/Button" data-ouia-safe="true" type="button" @@ -37,45 +37,13 @@ exports[`NotificationBadge count 1`] = ` `; -exports[`false NotificationBadge 1`] = ` - - - -`; - exports[`false NotificationBadge needs attention 1`] = ` - -`; - exports[`true NotificationBadge needs attention 1`] = `