@patternfly/react-core 4.202.15 → 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.
- package/CHANGELOG.md +24 -0
- package/package.json +5 -5
- package/src/components/ContextSelector/examples/ContextSelector.md +3 -279
- package/src/components/ContextSelector/examples/ContextSelectorBasic.tsx +84 -0
- package/src/components/ContextSelector/examples/ContextSelectorPlainText.tsx +85 -0
- package/src/components/ContextSelector/examples/ContextSelectorWithFooter.tsx +91 -0
- package/src/components/Divider/examples/Divider.md +15 -68
- package/src/components/Divider/examples/DividerInsetMedium.tsx +4 -0
- package/src/components/Divider/examples/DividerInsetVariousBreakpoints.tsx +13 -0
- package/src/components/Divider/examples/DividerUsingDiv.tsx +4 -0
- package/src/components/Divider/examples/DividerUsingHr.tsx +4 -0
- package/src/components/Divider/examples/DividerUsingLi.tsx +10 -0
- package/src/components/Divider/examples/DividerVerticalFlex.tsx +10 -0
- package/src/components/Divider/examples/DividerVerticalFlexInsetMedium.tsx +10 -0
- package/src/components/Divider/examples/DividerVerticalFlexInsetVariousBreakpoints.tsx +18 -0
- package/src/components/FormSelect/__tests__/FormSelect.test.tsx +0 -1
- package/src/components/List/__tests__/List.test.tsx +33 -33
- package/src/components/List/__tests__/__snapshots__/List.test.tsx.snap +33 -64
- package/src/components/Menu/__tests__/Menu.test.tsx +37 -33
- package/src/components/Menu/__tests__/__snapshots__/Menu.test.tsx.snap +3 -36
- package/src/components/Modal/__tests__/Modal.test.tsx +65 -67
- package/src/components/Modal/__tests__/ModalBoxCloseButton.test.tsx +13 -10
- package/src/components/Nav/__tests__/Nav.test.tsx +185 -214
- package/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap +877 -1729
- package/src/components/NotificationDrawer/__tests__/NotificationDrawer.test.tsx +13 -15
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerBody.test.tsx +13 -15
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerGroup.test.tsx +21 -27
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerGroupList.test.tsx +13 -15
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerHeader.test.tsx +25 -27
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerList.test.tsx +17 -19
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItem.test.tsx +20 -27
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemBody.test.tsx +17 -13
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemHeader.test.tsx +30 -25
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawer.test.tsx.snap +3 -5
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerBody.test.tsx.snap +3 -5
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerGroup.test.tsx.snap +9 -11
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerGroupList.test.tsx.snap +3 -5
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerHeader.test.tsx.snap +16 -18
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerList.test.tsx.snap +7 -8
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItem.test.tsx.snap +3 -5
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItemBody.test.tsx.snap +6 -8
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItemHeader.test.tsx.snap +12 -14
- package/src/components/OverflowMenu/__tests__/OverflowMenu.test.tsx +15 -12
- package/src/components/OverflowMenu/__tests__/OverflowMenuControl.test.tsx +9 -8
- package/src/components/OverflowMenu/__tests__/OverflowMenuGroup.test.tsx +17 -18
- package/src/components/OverflowMenu/__tests__/OverflowMenuItem.test.tsx +10 -9
- package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenu.test.tsx.snap +6 -16
- package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenuControl.test.tsx.snap +3 -15
- package/src/components/OverflowMenu/__tests__/__snapshots__/OverflowMenuItem.test.tsx.snap +3 -17
- package/src/components/Modal/__tests__/__snapshots__/ModalBoxCloseButton.test.tsx.snap +0 -16
- 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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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('
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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('
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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('
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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('
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
const view = shallow(<NotificationDrawerHeader className="extra-class" />);
|
|
13
|
-
expect(view.prop('className')).toMatchSnapshot();
|
|
14
|
-
});
|
|
6
|
+
import { NotificationDrawerHeader } from '../NotificationDrawerHeader';
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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('
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
const view = shallow(<NotificationDrawerList className="extra-class" />);
|
|
13
|
-
expect(view.prop('className')).toMatchSnapshot();
|
|
14
|
-
});
|
|
6
|
+
import { NotificationDrawerList } from '../NotificationDrawerList';
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
expect(view.container).toMatchSnapshot();
|
|
9
|
-
});
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import "@testing-library/jest-dom";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
const view = shallow(<NotificationDrawerListItem className="extra-class" />);
|
|
13
|
-
expect(view.prop('className')).toMatchSnapshot();
|
|
14
|
-
});
|
|
6
|
+
import { NotificationDrawerListItem } from '../NotificationDrawerListItem';
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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('
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
18
|
-
|
|
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
|
});
|
package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemHeader.test.tsx
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
});
|
package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawer.test.tsx.snap
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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
|
-
</
|
|
8
|
+
</DocumentFragment>
|
|
11
9
|
`;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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
|
-
</
|
|
8
|
+
</DocumentFragment>
|
|
11
9
|
`;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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
|
-
</
|
|
47
|
+
</DocumentFragment>
|
|
50
48
|
`;
|
|
51
49
|
|
|
52
|
-
exports[`drawer group with isRead applied 1`] = `
|
|
53
|
-
<
|
|
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
|
-
</
|
|
94
|
+
</DocumentFragment>
|
|
97
95
|
`;
|
|
98
96
|
|
|
99
|
-
exports[`renders with PatternFly Core styles 1`] = `
|
|
100
|
-
<
|
|
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
|
-
</
|
|
141
|
+
</DocumentFragment>
|
|
144
142
|
`;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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
|
-
</
|
|
8
|
+
</DocumentFragment>
|
|
11
9
|
`;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
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-
|
|
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
|
-
</
|
|
23
|
+
</DocumentFragment>
|
|
26
24
|
`;
|
|
27
25
|
|
|
28
|
-
exports[`drawer header with custom unread text applied 1`] = `
|
|
29
|
-
<
|
|
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-
|
|
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
|
-
</
|
|
46
|
+
</DocumentFragment>
|
|
49
47
|
`;
|
|
50
48
|
|
|
51
|
-
exports[`drawer header with title applied 1`] = `
|
|
52
|
-
<
|
|
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-
|
|
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
|
-
|
|
61
|
+
Some Title
|
|
64
62
|
</h1>
|
|
65
63
|
</div>
|
|
66
|
-
</
|
|
64
|
+
</DocumentFragment>
|
|
67
65
|
`;
|
|
68
66
|
|
|
69
|
-
exports[`renders with PatternFly Core styles 1`] = `
|
|
70
|
-
<
|
|
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
|
-
</
|
|
82
|
+
</DocumentFragment>
|
|
85
83
|
`;
|