@patternfly/react-core 4.202.17 → 4.202.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +5 -5
  3. package/src/components/ContextSelector/examples/ContextSelector.md +3 -279
  4. package/src/components/ContextSelector/examples/ContextSelectorBasic.tsx +84 -0
  5. package/src/components/ContextSelector/examples/ContextSelectorPlainText.tsx +85 -0
  6. package/src/components/ContextSelector/examples/ContextSelectorWithFooter.tsx +91 -0
  7. package/src/components/Divider/examples/Divider.md +15 -68
  8. package/src/components/Divider/examples/DividerInsetMedium.tsx +4 -0
  9. package/src/components/Divider/examples/DividerInsetVariousBreakpoints.tsx +13 -0
  10. package/src/components/Divider/examples/DividerUsingDiv.tsx +4 -0
  11. package/src/components/Divider/examples/DividerUsingHr.tsx +4 -0
  12. package/src/components/Divider/examples/DividerUsingLi.tsx +10 -0
  13. package/src/components/Divider/examples/DividerVerticalFlex.tsx +10 -0
  14. package/src/components/Divider/examples/DividerVerticalFlexInsetMedium.tsx +10 -0
  15. package/src/components/Divider/examples/DividerVerticalFlexInsetVariousBreakpoints.tsx +18 -0
  16. package/src/components/FormSelect/__tests__/FormSelect.test.tsx +0 -1
  17. package/src/components/List/__tests__/List.test.tsx +33 -33
  18. package/src/components/List/__tests__/__snapshots__/List.test.tsx.snap +33 -64
  19. package/src/components/Menu/__tests__/Menu.test.tsx +37 -33
  20. package/src/components/Menu/__tests__/__snapshots__/Menu.test.tsx.snap +3 -36
  21. package/src/components/Modal/__tests__/Modal.test.tsx +65 -67
  22. package/src/components/Modal/__tests__/ModalBoxCloseButton.test.tsx +13 -10
  23. package/src/components/Nav/__tests__/Nav.test.tsx +185 -214
  24. package/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap +877 -1729
  25. package/src/components/NotificationDrawer/__tests__/NotificationDrawer.test.tsx +13 -15
  26. package/src/components/NotificationDrawer/__tests__/NotificationDrawerBody.test.tsx +13 -15
  27. package/src/components/NotificationDrawer/__tests__/NotificationDrawerGroup.test.tsx +21 -27
  28. package/src/components/NotificationDrawer/__tests__/NotificationDrawerGroupList.test.tsx +13 -15
  29. package/src/components/NotificationDrawer/__tests__/NotificationDrawerHeader.test.tsx +25 -27
  30. package/src/components/NotificationDrawer/__tests__/NotificationDrawerList.test.tsx +17 -19
  31. package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItem.test.tsx +20 -27
  32. package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemBody.test.tsx +17 -13
  33. package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemHeader.test.tsx +30 -25
  34. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawer.test.tsx.snap +3 -5
  35. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerBody.test.tsx.snap +3 -5
  36. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerGroup.test.tsx.snap +9 -11
  37. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerGroupList.test.tsx.snap +3 -5
  38. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerHeader.test.tsx.snap +16 -18
  39. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerList.test.tsx.snap +7 -8
  40. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItem.test.tsx.snap +3 -5
  41. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItemBody.test.tsx.snap +6 -8
  42. package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItemHeader.test.tsx.snap +12 -14
  43. package/src/components/OverflowMenu/__tests__/OverflowMenu.test.tsx +15 -12
  44. package/src/components/OverflowMenu/__tests__/OverflowMenuControl.test.tsx +9 -8
  45. package/src/components/OverflowMenu/__tests__/OverflowMenuGroup.test.tsx +17 -18
  46. package/src/components/OverflowMenu/__tests__/OverflowMenuItem.test.tsx +10 -9
  47. package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenu.test.tsx.snap +6 -16
  48. package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenuControl.test.tsx.snap +3 -15
  49. package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenuItem.test.tsx.snap +3 -17
  50. package/src/components/Modal/__tests__/__snapshots__/ModalBoxCloseButton.test.tsx.snap +0 -16
  51. package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenuGroup.test.tsx.snap +0 -33
@@ -1,20 +1,18 @@
1
1
  import React from 'react';
2
- import { NotificationDrawer } from '../NotificationDrawer';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawer />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawer className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
6
+ import { NotificationDrawer } from '../NotificationDrawer';
7
+
8
+ describe('NotificationDrawer', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawer />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
15
13
 
16
- test('extra props are spread to the root element', () => {
17
- const testId = 'notification-drawer';
18
- const view = shallow(<NotificationDrawer data-testid={testId} />);
19
- expect(view.prop('data-testid')).toBe(testId);
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawer className="extra-class" data-testid="test-id" />);
16
+ expect(screen.getByTestId('test-id')).toHaveClass('extra-class');
17
+ });
20
18
  });
@@ -1,20 +1,18 @@
1
1
  import React from 'react';
2
- import { NotificationDrawerBody } from '../NotificationDrawerBody';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerBody />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawerBody className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
6
+ import { NotificationDrawerBody } from '../NotificationDrawerBody';
7
+
8
+ describe('NotificationDrawerBody', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerBody />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
15
13
 
16
- test('extra props are spread to the root element', () => {
17
- const testId = 'notification-drawer';
18
- const view = shallow(<NotificationDrawerBody data-testid={testId} />);
19
- expect(view.prop('data-testid')).toBe(testId);
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerBody className="extra-class" data-testid="test-id" />);
16
+ expect(screen.getByTestId('test-id')).toHaveClass('extra-class');
17
+ });
20
18
  });
@@ -1,34 +1,28 @@
1
1
  import React from 'react';
2
- import { NotificationDrawerGroup } from '../NotificationDrawerGroup';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerGroup count={2} isExpanded={false} title="Critical Alerts" />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(
13
- <NotificationDrawerGroup count={2} isExpanded={false} title="Critical Alerts" className="extra-class" />
14
- );
15
- expect(view.prop('className')).toMatchSnapshot();
16
- });
6
+ import { NotificationDrawerGroup } from '../NotificationDrawerGroup';
17
7
 
18
- test('extra props are spread to the root element', () => {
19
- const testId = 'notification-drawer';
20
- const view = shallow(
21
- <NotificationDrawerGroup count={2} isExpanded={false} title="Critical Alerts" data-testid={testId} />
22
- );
23
- expect(view.prop('data-testid')).toBe(testId);
24
- });
8
+ describe('NotificationDrawerGroup', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerGroup count={2} isExpanded={false} title="Critical Alerts" />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
25
13
 
26
- test('drawer group with isExpanded applied ', () => {
27
- const view = render(<NotificationDrawerGroup count={2} isExpanded title="Critical Alerts" />);
28
- expect(view.container).toMatchSnapshot();
29
- });
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerGroup count={2} isExpanded={false} title="Critical Alerts" className="extra-class" data-testid='test-id' />);
16
+ expect(screen.getByTestId('test-id')).toHaveClass('extra-class');
17
+ });
18
+
19
+ test('drawer group with isExpanded applied ', () => {
20
+ const { asFragment } = render(<NotificationDrawerGroup count={2} isExpanded title="Critical Alerts" />);
21
+ expect(asFragment()).toMatchSnapshot();
22
+ });
30
23
 
31
- test('drawer group with isRead applied ', () => {
32
- const view = render(<NotificationDrawerGroup count={2} isExpanded={false} isRead={true} title="Critical Alerts" />);
33
- expect(view.container).toMatchSnapshot();
24
+ test('drawer group with isRead applied ', () => {
25
+ const { asFragment } = render(<NotificationDrawerGroup count={2} isExpanded={false} isRead={true} title="Critical Alerts" />);
26
+ expect(asFragment()).toMatchSnapshot();
27
+ });
34
28
  });
@@ -1,20 +1,18 @@
1
1
  import React from 'react';
2
- import { NotificationDrawerGroupList } from '../NotificationDrawerGroupList';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerGroupList />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawerGroupList className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
6
+ import { NotificationDrawerGroupList } from '../NotificationDrawerGroupList';
7
+
8
+ describe('NotificationDrawerGroupList', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerGroupList />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
15
13
 
16
- test('extra props are spread to the root element', () => {
17
- const testId = 'notification-drawer';
18
- const view = shallow(<NotificationDrawerGroupList data-testid={testId} />);
19
- expect(view.prop('data-testid')).toBe(testId);
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerGroupList className="extra-class" data-testid="test-id" />);
16
+ expect(screen.getByTestId('test-id')).toHaveClass('extra-class');
17
+ });
20
18
  });
@@ -1,35 +1,33 @@
1
1
  import React from 'react';
2
- import { NotificationDrawerHeader } from '../NotificationDrawerHeader';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerHeader />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawerHeader className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
6
+ import { NotificationDrawerHeader } from '../NotificationDrawerHeader';
15
7
 
16
- test('extra props are spread to the root element', () => {
17
- const testId = 'notification-drawer';
18
- const view = shallow(<NotificationDrawerHeader data-testid={testId} />);
19
- expect(view.prop('data-testid')).toBe(testId);
20
- });
8
+ describe('NotificationDrawerHeader', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerHeader />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
21
13
 
22
- test('drawer header with count applied', () => {
23
- const view = render(<NotificationDrawerHeader count={2} />);
24
- expect(view.container).toMatchSnapshot();
25
- });
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerHeader className="extra-class" />);
16
+ expect(screen.getByText('Notifications').parentElement).toHaveClass('extra-class');
17
+ });
26
18
 
27
- test('drawer header with title applied', () => {
28
- const view = render(<NotificationDrawerHeader title="Notifications" />);
29
- expect(view.container).toMatchSnapshot();
30
- });
19
+ test('drawer header with count applied', () => {
20
+ const { asFragment } = render(<NotificationDrawerHeader count={2} />);
21
+ expect(asFragment()).toMatchSnapshot();
22
+ });
23
+
24
+ test('drawer header with title applied', () => {
25
+ const { asFragment } = render(<NotificationDrawerHeader title="Some Title" />);
26
+ expect(asFragment()).toMatchSnapshot();
27
+ });
31
28
 
32
- test('drawer header with custom unread text applied', () => {
33
- const view = render(<NotificationDrawerHeader customText="2 unread alerts" />);
34
- expect(view.container).toMatchSnapshot();
29
+ test('drawer header with custom unread text applied', () => {
30
+ const { asFragment } = render(<NotificationDrawerHeader customText="2 unread alerts" />);
31
+ expect(asFragment()).toMatchSnapshot();
32
+ });
35
33
  });
@@ -1,25 +1,23 @@
1
1
  import React from 'react';
2
- import { NotificationDrawerList } from '../NotificationDrawerList';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerList />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawerList className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
6
+ import { NotificationDrawerList } from '../NotificationDrawerList';
15
7
 
16
- test('extra props are spread to the root element', () => {
17
- const testId = 'notification-drawer';
18
- const view = shallow(<NotificationDrawerList data-testid={testId} />);
19
- expect(view.prop('data-testid')).toBe(testId);
20
- });
8
+ describe('NotificationDrawerList', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerList />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
13
+
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerList className="extra-class" />);
16
+ expect(screen.getByRole('list')).toHaveClass('extra-class');
17
+ });
21
18
 
22
- test('drawer list with hidden applied ', () => {
23
- const view = render(<NotificationDrawerList hidden />);
24
- expect(view.container).toMatchSnapshot();
19
+ test('drawer list with hidden applied ', () => {
20
+ const { asFragment } = render(<NotificationDrawerList isHidden />);
21
+ expect(asFragment()).toMatchSnapshot();
22
+ });
25
23
  });
@@ -1,35 +1,28 @@
1
1
  import React from 'react';
2
- import { NotificationDrawerListItem } from '../NotificationDrawerListItem';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
2
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerListItem />);
8
- expect(view.container).toMatchSnapshot();
9
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
10
5
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawerListItem className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
6
+ import { NotificationDrawerListItem } from '../NotificationDrawerListItem';
15
7
 
16
- test('extra props are spread to the root element', () => {
17
- const testId = 'notification-drawer';
18
- const view = shallow(<NotificationDrawerListItem data-testid={testId} />);
19
- expect(view.prop('data-testid')).toBe(testId);
20
- });
8
+ describe('NotificationDrawerListItem', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerListItem />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
21
13
 
22
- test('drawer list item with isHoverable applied ', () => {
23
- const view = shallow(<NotificationDrawerListItem isHoverable />);
24
- expect(view.prop('className')).toMatch(/hoverable/);
25
- });
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerListItem className="extra-class" />);
16
+ expect(screen.getByRole('listitem')).toHaveClass('extra-class');
17
+ });
26
18
 
27
- test('drawer list item with isRead applied ', () => {
28
- const view = shallow(<NotificationDrawerListItem isRead />);
29
- expect(view.prop('className')).toMatch(/read/);
30
- });
19
+ test('drawer list item with isHoverable applied', () => {
20
+ render(<NotificationDrawerListItem isHoverable />);
21
+ expect(screen.getByRole('listitem')).toHaveClass('pf-m-hoverable');
22
+ });
31
23
 
32
- test('drawer list item with tabIndex value applied ', () => {
33
- const view = shallow(<NotificationDrawerListItem tabIndex={4} />);
34
- expect(view.prop('tabIndex')).toBe(4);
24
+ test('drawer list item with isRead applied', () => {
25
+ render(<NotificationDrawerListItem isRead />);
26
+ expect(screen.getByRole('listitem')).toHaveClass('pf-m-read');
27
+ });
35
28
  });
@@ -1,19 +1,23 @@
1
1
  import React from 'react';
2
+
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
5
+
2
6
  import { NotificationDrawerListItemBody } from '../NotificationDrawerListItemBody';
3
- import { render } from '@testing-library/react';
4
- import { shallow } from 'enzyme';
5
7
 
6
- test('renders with PatternFly Core styles', () => {
7
- const view = render(<NotificationDrawerListItemBody />);
8
- expect(view.container).toMatchSnapshot();
9
- });
8
+ describe('NotificationDrawerListItemBody', () => {
9
+ test('renders with PatternFly Core styles', () => {
10
+ const { asFragment } = render(<NotificationDrawerListItemBody />);
11
+ expect(asFragment()).toMatchSnapshot();
12
+ });
10
13
 
11
- test('className is added to the root element', () => {
12
- const view = shallow(<NotificationDrawerListItemBody className="extra-class" />);
13
- expect(view.prop('className')).toMatchSnapshot();
14
- });
14
+ test('className is added to the root element', () => {
15
+ render(<NotificationDrawerListItemBody className="extra-class" data-testid="test-id" />);
16
+ expect(screen.getByTestId('test-id')).toHaveClass('extra-class');
17
+ });
15
18
 
16
- test('list item body with timestamp property applied ', () => {
17
- const view = render(<NotificationDrawerListItemBody timestamp="5 minutes ago" />);
18
- expect(view.container).toMatchSnapshot();
19
+ test('list item body with timestamp property applied', () => {
20
+ const { asFragment } = render(<NotificationDrawerListItemBody timestamp="5 minutes ago" />);
21
+ expect(asFragment()).toMatchSnapshot();
22
+ });
19
23
  });
@@ -1,35 +1,40 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import { mount } from 'enzyme';
2
+
3
+ import { render, screen } from '@testing-library/react';
4
+ import "@testing-library/jest-dom";
5
+
4
6
  import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
5
7
  import { NotificationDrawerListItemHeader } from '../NotificationDrawerListItemHeader';
6
8
 
7
- test('renders with PatternFly Core styles', () => {
8
- const view = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly"/>);
9
- expect(view.container).toMatchSnapshot();
10
- });
9
+ describe('NotificationDrawerListItemHeader', () => {
10
+ test('renders with PatternFly Core styles', () => {
11
+ const { asFragment } = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" />);
12
+ expect(asFragment()).toMatchSnapshot();
13
+ });
11
14
 
12
- test('className is added to the root element', () => {
13
- const view = mount(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" className="extra-class" />);
14
- expect(view.prop('className')).toMatchSnapshot();
15
- });
15
+ test('className is added to the root element', () => {
16
+ render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" className="extra-class" data-testid='test-id' />);
17
+ expect(screen.getByTestId('test-id')).toHaveClass('extra-class');
18
+ });
16
19
 
17
- test('list item header with custom icon applied ', () => {
18
- const view = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" icon={<BellIcon />} />);
19
- expect(view.container).toMatchSnapshot();
20
- });
20
+ test('list item header with custom icon applied ', () => {
21
+ const { asFragment } = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" icon={<BellIcon />} />);
22
+ expect(asFragment()).toMatchSnapshot();
23
+ });
21
24
 
22
- test('list item header with srTitle applied ', () => {
23
- const view = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" srTitle="screen reader title" />);
24
- expect(view.container).toMatchSnapshot();
25
- });
25
+ test('list item header with srTitle applied ', () => {
26
+ const { asFragment } = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" srTitle="screen reader title" />);
27
+ expect(asFragment()).toMatchSnapshot();
28
+ });
26
29
 
27
- test('list item header with variant applied ', () => {
28
- const view = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" variant="success" />);
29
- expect(view.container).toMatchSnapshot();
30
- });
30
+ test('list item header with variant applied ', () => {
31
+ const { asFragment } = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" variant="success" />);
32
+ expect(asFragment()).toMatchSnapshot();
33
+ });
34
+
35
+ test('list item header with truncateTitle', () => {
36
+ render(<NotificationDrawerListItemHeader truncateTitle={1} title="Pod quit unexpectedly" variant="success" />);
31
37
 
32
- test('list item header with truncateTitle', () => {
33
- const view = mount(<NotificationDrawerListItemHeader truncateTitle={1} title="Pod quit unexpectedly" variant="success" />);
34
- expect(view.find('h2').prop('className')).toContain('pf-m-truncate');
38
+ expect(screen.getByText('Pod quit unexpectedly')).toHaveClass('pf-m-truncate');
39
+ });
35
40
  });
@@ -1,11 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`className is added to the root element 1`] = `"extra-class"`;
4
-
5
- exports[`renders with PatternFly Core styles 1`] = `
6
- <div>
3
+ exports[`NotificationDrawer renders with PatternFly Core styles 1`] = `
4
+ <DocumentFragment>
7
5
  <div
8
6
  class="pf-c-notification-drawer"
9
7
  />
10
- </div>
8
+ </DocumentFragment>
11
9
  `;
@@ -1,11 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`className is added to the root element 1`] = `"pf-c-notification-drawer__body extra-class"`;
4
-
5
- exports[`renders with PatternFly Core styles 1`] = `
6
- <div>
3
+ exports[`NotificationDrawerBody renders with PatternFly Core styles 1`] = `
4
+ <DocumentFragment>
7
5
  <div
8
6
  class="pf-c-notification-drawer__body"
9
7
  />
10
- </div>
8
+ </DocumentFragment>
11
9
  `;
@@ -1,9 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`className is added to the root element 1`] = `"pf-c-notification-drawer__group extra-class"`;
4
-
5
- exports[`drawer group with isExpanded applied 1`] = `
6
- <div>
3
+ exports[`NotificationDrawerGroup drawer group with isExpanded applied 1`] = `
4
+ <DocumentFragment>
7
5
  <section
8
6
  class="pf-c-notification-drawer__group pf-m-expanded"
9
7
  >
@@ -46,11 +44,11 @@ exports[`drawer group with isExpanded applied 1`] = `
46
44
  </button>
47
45
  </h1>
48
46
  </section>
49
- </div>
47
+ </DocumentFragment>
50
48
  `;
51
49
 
52
- exports[`drawer group with isRead applied 1`] = `
53
- <div>
50
+ exports[`NotificationDrawerGroup drawer group with isRead applied 1`] = `
51
+ <DocumentFragment>
54
52
  <section
55
53
  class="pf-c-notification-drawer__group"
56
54
  >
@@ -93,11 +91,11 @@ exports[`drawer group with isRead applied 1`] = `
93
91
  </button>
94
92
  </h1>
95
93
  </section>
96
- </div>
94
+ </DocumentFragment>
97
95
  `;
98
96
 
99
- exports[`renders with PatternFly Core styles 1`] = `
100
- <div>
97
+ exports[`NotificationDrawerGroup renders with PatternFly Core styles 1`] = `
98
+ <DocumentFragment>
101
99
  <section
102
100
  class="pf-c-notification-drawer__group"
103
101
  >
@@ -140,5 +138,5 @@ exports[`renders with PatternFly Core styles 1`] = `
140
138
  </button>
141
139
  </h1>
142
140
  </section>
143
- </div>
141
+ </DocumentFragment>
144
142
  `;
@@ -1,11 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`className is added to the root element 1`] = `"pf-c-notification-drawer__group-list extra-class"`;
4
-
5
- exports[`renders with PatternFly Core styles 1`] = `
6
- <div>
3
+ exports[`NotificationDrawerGroupList renders with PatternFly Core styles 1`] = `
4
+ <DocumentFragment>
7
5
  <div
8
6
  class="pf-c-notification-drawer__group-list"
9
7
  />
10
- </div>
8
+ </DocumentFragment>
11
9
  `;
@@ -1,15 +1,13 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`className is added to the root element 1`] = `"pf-c-notification-drawer__header extra-class"`;
4
-
5
- exports[`drawer header with count applied 1`] = `
6
- <div>
3
+ exports[`NotificationDrawerHeader drawer header with count applied 1`] = `
4
+ <DocumentFragment>
7
5
  <div
8
6
  class="pf-c-notification-drawer__header"
9
7
  >
10
8
  <h1
11
9
  class="pf-c-notification-drawer__header-title"
12
- data-ouia-component-id="OUIA-Generated-Text-2"
10
+ data-ouia-component-id="OUIA-Generated-Text-3"
13
11
  data-ouia-component-type="PF4/Text"
14
12
  data-ouia-safe="true"
15
13
  data-pf-content="true"
@@ -22,17 +20,17 @@ exports[`drawer header with count applied 1`] = `
22
20
  2 unread
23
21
  </span>
24
22
  </div>
25
- </div>
23
+ </DocumentFragment>
26
24
  `;
27
25
 
28
- exports[`drawer header with custom unread text applied 1`] = `
29
- <div>
26
+ exports[`NotificationDrawerHeader drawer header with custom unread text applied 1`] = `
27
+ <DocumentFragment>
30
28
  <div
31
29
  class="pf-c-notification-drawer__header"
32
30
  >
33
31
  <h1
34
32
  class="pf-c-notification-drawer__header-title"
35
- data-ouia-component-id="OUIA-Generated-Text-4"
33
+ data-ouia-component-id="OUIA-Generated-Text-5"
36
34
  data-ouia-component-type="PF4/Text"
37
35
  data-ouia-safe="true"
38
36
  data-pf-content="true"
@@ -45,29 +43,29 @@ exports[`drawer header with custom unread text applied 1`] = `
45
43
  2 unread alerts
46
44
  </span>
47
45
  </div>
48
- </div>
46
+ </DocumentFragment>
49
47
  `;
50
48
 
51
- exports[`drawer header with title applied 1`] = `
52
- <div>
49
+ exports[`NotificationDrawerHeader drawer header with title applied 1`] = `
50
+ <DocumentFragment>
53
51
  <div
54
52
  class="pf-c-notification-drawer__header"
55
53
  >
56
54
  <h1
57
55
  class="pf-c-notification-drawer__header-title"
58
- data-ouia-component-id="OUIA-Generated-Text-3"
56
+ data-ouia-component-id="OUIA-Generated-Text-4"
59
57
  data-ouia-component-type="PF4/Text"
60
58
  data-ouia-safe="true"
61
59
  data-pf-content="true"
62
60
  >
63
- Notifications
61
+ Some Title
64
62
  </h1>
65
63
  </div>
66
- </div>
64
+ </DocumentFragment>
67
65
  `;
68
66
 
69
- exports[`renders with PatternFly Core styles 1`] = `
70
- <div>
67
+ exports[`NotificationDrawerHeader renders with PatternFly Core styles 1`] = `
68
+ <DocumentFragment>
71
69
  <div
72
70
  class="pf-c-notification-drawer__header"
73
71
  >
@@ -81,5 +79,5 @@ exports[`renders with PatternFly Core styles 1`] = `
81
79
  Notifications
82
80
  </h1>
83
81
  </div>
84
- </div>
82
+ </DocumentFragment>
85
83
  `;