@dhis2-ui/notice-box 10.0.0-alpha.7 → 10.0.0

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.
@@ -6,7 +6,7 @@ var _noticeBoxIcon = require("../notice-box-icon.js");
6
6
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
7
  describe('NoticeBoxIcon', () => {
8
8
  it('should render info icon by default', () => {
9
- const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
9
+ const wrapper = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
10
10
  dataTest: "test"
11
11
  }));
12
12
  expect(wrapper.find('SvgWarningFilled24')).toHaveLength(0);
@@ -15,18 +15,18 @@ describe('NoticeBoxIcon', () => {
15
15
  });
16
16
  it('should log errors when both warning and error flag are set', () => {
17
17
  const spy = jest.spyOn(global.console, 'error').mockImplementation(() => {});
18
- (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
18
+ (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
19
19
  warning: true,
20
20
  error: true,
21
21
  dataTest: "test"
22
22
  }));
23
- expect(spy.mock.calls[0][0]).toMatchSnapshot();
24
- expect(spy.mock.calls[1][0]).toMatchSnapshot();
23
+ expect(spy.mock.calls[0]).toEqual(['Warning: Failed %s type: %s%s', 'prop', "Invalid prop `error` supplied to `NoticeBoxIcon`, Property 'error' is mutually exclusive with 'warning', but both have a thruthy value.", expect.any(String)]);
24
+ expect(spy.mock.calls[1]).toEqual(['Warning: Failed %s type: %s%s', 'prop', "Invalid prop `warning` supplied to `NoticeBoxIcon`, Property 'warning' is mutually exclusive with 'error', but both have a thruthy value.", expect.any(String)]);
25
25
  spy.mockRestore();
26
26
  });
27
27
  it('should render error icon when both warning and error flag are set', () => {
28
28
  const spy = jest.spyOn(global.console, 'error').mockImplementation(() => {});
29
- const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
29
+ const wrapper = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
30
30
  warning: true,
31
31
  error: true,
32
32
  dataTest: "test"
@@ -37,7 +37,7 @@ describe('NoticeBoxIcon', () => {
37
37
  spy.mockRestore();
38
38
  });
39
39
  it('should render error icon when only error flag is set', () => {
40
- const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
40
+ const wrapper = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
41
41
  error: true,
42
42
  dataTest: "test"
43
43
  }));
@@ -46,7 +46,7 @@ describe('NoticeBoxIcon', () => {
46
46
  expect(wrapper.find('SvgInfoFilled24')).toHaveLength(0);
47
47
  });
48
48
  it('should render warning icon when only warning flag is set', () => {
49
- const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
49
+ const wrapper = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxIcon.NoticeBoxIcon, {
50
50
  warning: true,
51
51
  dataTest: "test"
52
52
  }));
@@ -12,7 +12,7 @@ describe('NoticeBoxMessage', () => {
12
12
  expect((0, _noticeBoxMessage.NoticeBoxMessage)(props)).toBe(null);
13
13
  });
14
14
  it('should render children', () => {
15
- const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxMessage.NoticeBoxMessage, {
15
+ const wrapper = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxMessage.NoticeBoxMessage, {
16
16
  dataTest: "test"
17
17
  }, "children"));
18
18
  expect(wrapper.text()).toEqual(expect.stringContaining('children'));
@@ -12,7 +12,7 @@ describe('NoticeBoxTitle', () => {
12
12
  expect((0, _noticeBoxTitle.NoticeBoxTitle)(props)).toBe(null);
13
13
  });
14
14
  it('should render title', () => {
15
- const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_noticeBoxTitle.NoticeBoxTitle, {
15
+ const wrapper = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_noticeBoxTitle.NoticeBoxTitle, {
16
16
  title: "title",
17
17
  dataTest: "test"
18
18
  }));
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { NoticeBoxIcon } from '../notice-box-icon.js';
4
4
  describe('NoticeBoxIcon', () => {
5
5
  it('should render info icon by default', () => {
6
- const wrapper = shallow( /*#__PURE__*/React.createElement(NoticeBoxIcon, {
6
+ const wrapper = shallow(/*#__PURE__*/React.createElement(NoticeBoxIcon, {
7
7
  dataTest: "test"
8
8
  }));
9
9
  expect(wrapper.find('SvgWarningFilled24')).toHaveLength(0);
@@ -12,18 +12,18 @@ describe('NoticeBoxIcon', () => {
12
12
  });
13
13
  it('should log errors when both warning and error flag are set', () => {
14
14
  const spy = jest.spyOn(global.console, 'error').mockImplementation(() => {});
15
- shallow( /*#__PURE__*/React.createElement(NoticeBoxIcon, {
15
+ shallow(/*#__PURE__*/React.createElement(NoticeBoxIcon, {
16
16
  warning: true,
17
17
  error: true,
18
18
  dataTest: "test"
19
19
  }));
20
- expect(spy.mock.calls[0][0]).toMatchSnapshot();
21
- expect(spy.mock.calls[1][0]).toMatchSnapshot();
20
+ expect(spy.mock.calls[0]).toEqual(['Warning: Failed %s type: %s%s', 'prop', "Invalid prop `error` supplied to `NoticeBoxIcon`, Property 'error' is mutually exclusive with 'warning', but both have a thruthy value.", expect.any(String)]);
21
+ expect(spy.mock.calls[1]).toEqual(['Warning: Failed %s type: %s%s', 'prop', "Invalid prop `warning` supplied to `NoticeBoxIcon`, Property 'warning' is mutually exclusive with 'error', but both have a thruthy value.", expect.any(String)]);
22
22
  spy.mockRestore();
23
23
  });
24
24
  it('should render error icon when both warning and error flag are set', () => {
25
25
  const spy = jest.spyOn(global.console, 'error').mockImplementation(() => {});
26
- const wrapper = shallow( /*#__PURE__*/React.createElement(NoticeBoxIcon, {
26
+ const wrapper = shallow(/*#__PURE__*/React.createElement(NoticeBoxIcon, {
27
27
  warning: true,
28
28
  error: true,
29
29
  dataTest: "test"
@@ -34,7 +34,7 @@ describe('NoticeBoxIcon', () => {
34
34
  spy.mockRestore();
35
35
  });
36
36
  it('should render error icon when only error flag is set', () => {
37
- const wrapper = shallow( /*#__PURE__*/React.createElement(NoticeBoxIcon, {
37
+ const wrapper = shallow(/*#__PURE__*/React.createElement(NoticeBoxIcon, {
38
38
  error: true,
39
39
  dataTest: "test"
40
40
  }));
@@ -43,7 +43,7 @@ describe('NoticeBoxIcon', () => {
43
43
  expect(wrapper.find('SvgInfoFilled24')).toHaveLength(0);
44
44
  });
45
45
  it('should render warning icon when only warning flag is set', () => {
46
- const wrapper = shallow( /*#__PURE__*/React.createElement(NoticeBoxIcon, {
46
+ const wrapper = shallow(/*#__PURE__*/React.createElement(NoticeBoxIcon, {
47
47
  warning: true,
48
48
  dataTest: "test"
49
49
  }));
@@ -9,7 +9,7 @@ describe('NoticeBoxMessage', () => {
9
9
  expect(NoticeBoxMessage(props)).toBe(null);
10
10
  });
11
11
  it('should render children', () => {
12
- const wrapper = shallow( /*#__PURE__*/React.createElement(NoticeBoxMessage, {
12
+ const wrapper = shallow(/*#__PURE__*/React.createElement(NoticeBoxMessage, {
13
13
  dataTest: "test"
14
14
  }, "children"));
15
15
  expect(wrapper.text()).toEqual(expect.stringContaining('children'));
@@ -9,7 +9,7 @@ describe('NoticeBoxTitle', () => {
9
9
  expect(NoticeBoxTitle(props)).toBe(null);
10
10
  });
11
11
  it('should render title', () => {
12
- const wrapper = shallow( /*#__PURE__*/React.createElement(NoticeBoxTitle, {
12
+ const wrapper = shallow(/*#__PURE__*/React.createElement(NoticeBoxTitle, {
13
13
  title: "title",
14
14
  dataTest: "test"
15
15
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/notice-box",
3
- "version": "10.0.0-alpha.7",
3
+ "version": "10.0.0",
4
4
  "description": "UI NoticeBox",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,14 +27,14 @@
27
27
  "test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
28
28
  },
29
29
  "peerDependencies": {
30
- "react": "^16.13",
31
- "react-dom": "^16.13",
30
+ "react": "^16.13 || ^18",
31
+ "react-dom": "^16.13 || ^18",
32
32
  "styled-jsx": "^4"
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.1.2",
36
- "@dhis2/ui-constants": "10.0.0-alpha.7",
37
- "@dhis2/ui-icons": "10.0.0-alpha.7",
36
+ "@dhis2/ui-constants": "10.0.0",
37
+ "@dhis2/ui-icons": "10.0.0",
38
38
  "classnames": "^2.3.1",
39
39
  "prop-types": "^15.7.2"
40
40
  },
@@ -43,8 +43,8 @@
43
43
  "types"
44
44
  ],
45
45
  "devDependencies": {
46
- "react": "16.13",
47
- "react-dom": "16.13",
46
+ "react": "^18.3.1",
47
+ "react-dom": "^18.3.1",
48
48
  "styled-jsx": "^4.0.1"
49
49
  },
50
50
  "types": "types"
@@ -1,11 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`NoticeBoxIcon should log errors when both warning and error flag are set 1`] = `
4
- "Warning: Failed prop type: Invalid prop \`error\` supplied to \`NoticeBoxIcon\`, Property 'error' is mutually exclusive with 'warning', but both have a thruthy value.
5
- in NoticeBoxIcon"
6
- `;
7
-
8
- exports[`NoticeBoxIcon should log errors when both warning and error flag are set 2`] = `
9
- "Warning: Failed prop type: Invalid prop \`warning\` supplied to \`NoticeBoxIcon\`, Property 'warning' is mutually exclusive with 'error', but both have a thruthy value.
10
- in NoticeBoxIcon"
11
- `;
@@ -1,11 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`NoticeBoxIcon should log errors when both warning and error flag are set 1`] = `
4
- "Warning: Failed prop type: Invalid prop \`error\` supplied to \`NoticeBoxIcon\`, Property 'error' is mutually exclusive with 'warning', but both have a thruthy value.
5
- in NoticeBoxIcon"
6
- `;
7
-
8
- exports[`NoticeBoxIcon should log errors when both warning and error flag are set 2`] = `
9
- "Warning: Failed prop type: Invalid prop \`warning\` supplied to \`NoticeBoxIcon\`, Property 'warning' is mutually exclusive with 'error', but both have a thruthy value.
10
- in NoticeBoxIcon"
11
- `;