@sb1/ffe-lists-react 5.0.1 → 5.0.5

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 (39) hide show
  1. package/es/BulletList.js +3 -1
  2. package/es/BulletListItem.js +3 -1
  3. package/es/CheckList.js +3 -1
  4. package/es/CheckListItem.js +3 -1
  5. package/es/DescriptionList.js +3 -1
  6. package/es/DescriptionListDescription.js +3 -1
  7. package/es/DescriptionListMultiCol.js +3 -1
  8. package/es/DescriptionListTerm.js +3 -1
  9. package/es/NumberedList.js +3 -1
  10. package/es/NumberedListItem.js +3 -1
  11. package/es/StylizedNumberedList.js +3 -1
  12. package/es/StylizedNumberedListItem.js +3 -1
  13. package/lib/BulletList.js +3 -1
  14. package/lib/BulletListItem.js +3 -1
  15. package/lib/CheckList.js +3 -1
  16. package/lib/CheckListItem.js +3 -1
  17. package/lib/DescriptionList.js +3 -1
  18. package/lib/DescriptionListDescription.js +3 -1
  19. package/lib/DescriptionListMultiCol.js +3 -1
  20. package/lib/DescriptionListTerm.js +3 -1
  21. package/lib/NumberedList.js +3 -1
  22. package/lib/NumberedListItem.js +3 -1
  23. package/lib/StylizedNumberedList.js +3 -1
  24. package/lib/StylizedNumberedListItem.js +3 -1
  25. package/lib/index.js +16 -16
  26. package/package.json +10 -12
  27. package/CHANGELOG.md +0 -287
  28. package/es/BulletList.spec.js +0 -37
  29. package/es/CheckList.spec.js +0 -60
  30. package/es/DescriptionList.spec.js +0 -48
  31. package/es/DescriptionListMultiCol.spec.js +0 -39
  32. package/es/NumberedList.spec.js +0 -37
  33. package/es/StylizedNumberedList.spec.js +0 -30
  34. package/lib/BulletList.spec.js +0 -44
  35. package/lib/CheckList.spec.js +0 -67
  36. package/lib/DescriptionList.spec.js +0 -56
  37. package/lib/DescriptionListMultiCol.spec.js +0 -47
  38. package/lib/NumberedList.spec.js +0 -44
  39. package/lib/StylizedNumberedList.spec.js +0 -37
package/CHANGELOG.md DELETED
@@ -1,287 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@5.0.0...@sb1/ffe-lists-react@5.0.1) (2021-02-02)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **ffe-lists-react:** reduce vulnerabilities ([3bd41f1](https://github.com/SpareBank1/designsystem/commit/3bd41f1eddb5356ffe45729012aae98411887ecf))
12
-
13
-
14
-
15
-
16
-
17
- # [5.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@4.0.1...@sb1/ffe-lists-react@5.0.0) (2019-08-27)
18
-
19
- ### chore
20
-
21
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
22
-
23
- ### BREAKING CHANGES
24
-
25
- - peerDep of React is raised to 16.9. While this in itself
26
- isn't a breaking change, it allows for the use of hooks in later releases.
27
- Such changes would just be a minor version, or even a patch, but without
28
- this major version bump it would result in a runtime error for consumers.
29
-
30
- ## [4.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@4.0.0...@sb1/ffe-lists-react@4.0.1) (2019-05-14)
31
-
32
- ### Bug Fixes
33
-
34
- - **ffe-lists-react:** updating peerDependencies ([ea9edaf](https://github.com/SpareBank1/designsystem/commit/ea9edaf))
35
-
36
- # [4.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.4.0...@sb1/ffe-lists-react@4.0.0) (2019-05-13)
37
-
38
- ### Features
39
-
40
- - **ffe-lists-react:** added vertical description list ([e7b4165](https://github.com/SpareBank1/designsystem/commit/e7b4165))
41
-
42
- ### BREAKING CHANGES
43
-
44
- - **ffe-lists-react:** The description list is now vertical by default. To get old behaviour 'horizontal' prop must be passed.
45
-
46
- # [3.4.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.3.2...@sb1/ffe-lists-react@3.4.0) (2019-05-10)
47
-
48
- ### Features
49
-
50
- - **ffe-lists-react:** Added type definitions for typescript ([d17c769](https://github.com/SpareBank1/designsystem/commit/d17c769))
51
-
52
- ## [3.3.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.3.1...@sb1/ffe-lists-react@3.3.2) (2019-04-25)
53
-
54
- ### Bug Fixes
55
-
56
- - **ffe-lists-react:** Fix linting errors ([560c31b](https://github.com/SpareBank1/designsystem/commit/560c31b))
57
-
58
- ## [3.3.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.3.0...@sb1/ffe-lists-react@3.3.1) (2018-12-11)
59
-
60
- ### Bug Fixes
61
-
62
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
63
-
64
- # [3.3.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.2.1...@sb1/ffe-lists-react@3.3.0) (2018-11-28)
65
-
66
- ### Features
67
-
68
- - **ffe-lists-react:** add condensed modifier to bullet and number list ([f779f9b](https://github.com/SpareBank1/designsystem/commit/f779f9b)), closes [#525](https://github.com/SpareBank1/designsystem/issues/525)
69
-
70
- ## [3.2.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.2.0...@sb1/ffe-lists-react@3.2.1) (2018-11-26)
71
-
72
- **Note:** Version bump only for package @sb1/ffe-lists-react
73
-
74
- # [3.2.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.1.1...@sb1/ffe-lists-react@3.2.0) (2018-11-19)
75
-
76
- ### Features
77
-
78
- - **ffe-lists-react:** Add columns-support to CheckList ([f4cf473](https://github.com/SpareBank1/designsystem/commit/f4cf473))
79
-
80
- ## [3.1.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.1.0...@sb1/ffe-lists-react@3.1.1) (2018-11-09)
81
-
82
- **Note:** Version bump only for package @sb1/ffe-lists-react
83
-
84
- # [3.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.0.5...@sb1/ffe-lists-react@3.1.0) (2018-11-08)
85
-
86
- ### Features
87
-
88
- - **ffe-lists-react:** Add list item components ([9470296](https://github.com/SpareBank1/designsystem/commit/9470296))
89
-
90
- <a name="3.0.5"></a>
91
-
92
- ## [3.0.5](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.0.4...@sb1/ffe-lists-react@3.0.5) (2018-08-09)
93
-
94
- **Note:** Version bump only for package @sb1/ffe-lists-react
95
-
96
- <a name="3.0.4"></a>
97
-
98
- ## [3.0.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.0.3...@sb1/ffe-lists-react@3.0.4) (2018-04-19)
99
-
100
- ### Bug Fixes
101
-
102
- - **ffe-lists-react:** Wrap dd+dt pairs in dl ([5adc23e](https://github.com/SpareBank1/designsystem/commit/5adc23e))
103
-
104
- <a name="3.0.3"></a>
105
-
106
- ## [3.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.0.2...@sb1/ffe-lists-react@3.0.3) (2018-03-27)
107
-
108
- **Note:** Version bump only for package @sb1/ffe-lists-react
109
-
110
- <a name="3.0.2"></a>
111
-
112
- ## [3.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.0.0...@sb1/ffe-lists-react@3.0.2) (2018-03-07)
113
-
114
- ### Bug Fixes
115
-
116
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
117
-
118
- <a name="3.0.1"></a>
119
-
120
- ## [3.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-lists-react@3.0.0...@sb1/ffe-lists-react@3.0.1) (2018-03-02)
121
-
122
- ### Bug Fixes
123
-
124
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
125
-
126
- <a name="3.0.0"></a>
127
-
128
- # 3.0.0 (2018-02-25)
129
-
130
- ### Chores
131
-
132
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
133
-
134
- ### Features
135
-
136
- - **ffe-lists-react:** Import ffe-lists-react ([8300ab0](https://github.com/SpareBank1/designsystem/commit/8300ab0))
137
-
138
- ### BREAKING CHANGES
139
-
140
- - All packages have been renamed to add the @sb1 scope.
141
-
142
- See links [1] and [2] to read more about package scopes.
143
-
144
- Unfortunately this requires you update both your dependencies in
145
- `package.json` and all `import` or `require` statements in your code.
146
- Also, you unfortunately have to upgrade all FFE packages at once due to
147
- dependency between packages. If you are on the latest version prior to
148
- this breaking change the upgrade should be a matter of updating
149
- `package.json` with new package names and versions, and updating your
150
- imports.
151
-
152
- To help find the proper package versions you can either browse to the
153
- packages you need or check out the list of Git tags either on
154
- Github [3] or by cloning the repository and running the `git tag`
155
- command. All package versions get a tag in the format
156
- _package@version_.
157
-
158
- Update your `package.json` with the latest package version and add the
159
- @sb1 scope to the package name:
160
-
161
- ```diff
162
- - "ffe-core": "11.0.2",
163
- + "@sb1/ffe-core": "11.0.2",
164
- ```
165
-
166
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
167
- case packages will be put in the `node_modules/@sb1/` directory. If your
168
- build depends on file paths (for instance for copying fonts) you need to
169
- update that path to include the scope.
170
-
171
- The directory structure also means you have to update your imports, both
172
- in Less and in JavaScript.
173
-
174
- Using `less-plugin-npm-import`:
175
-
176
- ```diff
177
- - @import 'npm://ffe-core/less/ffe';
178
- + @import 'npm://@sb1/ffe-core/less/ffe';
179
- ```
180
-
181
- Using Webpack:
182
-
183
- ```diff
184
- - @import '~ffe-core/less/ffe';
185
- + @import '~@sb1/ffe-core/less/ffe';
186
- ```
187
-
188
- Using plain old paths:
189
-
190
- ```diff
191
- - @import '../path/to/node_modules/ffe-core/less/ffe';
192
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
193
- ```
194
-
195
- JavaScript `import`:
196
-
197
- ```diff
198
- - import { ActionButton } from 'ffe-buttons-react';
199
- + import { ActionButton } from '@sb1/ffe-buttons-react';
200
- ```
201
-
202
- JavaScript `require`:
203
-
204
- ```diff
205
- - const { ActionButton } = require('ffe-buttons-react').default;
206
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
207
- ```
208
-
209
- [1]: https://docs.npmjs.com/misc/scope
210
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
211
- [3]: https://github.com/sparebank1/designsystem/tags
212
-
213
- <a name="2.1.6"></a>
214
-
215
- ## [2.1.6](https://github.com/SpareBank1/designsystem/compare/ffe-lists-react@2.1.5...ffe-lists-react@2.1.6) (2018-02-23)
216
-
217
- **Note:** Version bump only for package ffe-lists-react
218
-
219
- <a name="2.1.5"></a>
220
-
221
- ## [2.1.5](https://github.com/SpareBank1/designsystem/compare/ffe-lists-react@2.1.4...ffe-lists-react@2.1.5) (2018-02-22)
222
-
223
- **Note:** Version bump only for package ffe-lists-react
224
-
225
- <a name="2.1.4"></a>
226
-
227
- ## [2.1.4](https://github.com/SpareBank1/designsystem/compare/ffe-lists-react@2.1.3...ffe-lists-react@2.1.4) (2018-02-20)
228
-
229
- **Note:** Version bump only for package ffe-lists-react
230
-
231
- <a name="2.1.3"></a>
232
-
233
- ## [2.1.3](https://github.com/SpareBank1/designsystem/compare/ffe-lists-react@2.1.2...ffe-lists-react@2.1.3) (2018-02-15)
234
-
235
- **Note:** Version bump only for package ffe-lists-react
236
-
237
- <a name="2.1.2"></a>
238
-
239
- ## [2.1.2](https://github.com/SpareBank1/designsystem/compare/ffe-lists-react@2.1.1...ffe-lists-react@2.1.2) (2018-02-01)
240
-
241
- **Note:** Version bump only for package ffe-lists-react
242
-
243
- <a name="2.1.1"></a>
244
-
245
- ## [2.1.1](https://github.com/SpareBank1/designsystem/compare/ffe-lists-react@2.1.0...ffe-lists-react@2.1.1) (2018-01-22)
246
-
247
- **Note:** Version bump only for package ffe-lists-react
248
-
249
- <a name="2.1.0"></a>
250
-
251
- # 2.1.0 (2018-01-19)
252
-
253
- ### Features
254
-
255
- - **ffe-lists-react:** Import ffe-lists-react
256
-
257
- ## 2.0.3
258
-
259
- - Use PropTypes from prop-types package
260
-
261
- ## 2.0.2
262
-
263
- - Expand peerDep scope of `ffe-lists` to include `4.x`.
264
- - Remove peerDep on `ffe-core`.
265
-
266
- ## 2.0.1
267
-
268
- - Fixed erroneous reference to renamed file
269
-
270
- # 2.0.0
271
-
272
- - Breaking:
273
- _ Renamed `DescriptionListFlex` to `DescriptionList`
274
- _ Updated `DescriptionList` and `DescriptionListMultiCol` markup to reflect refactoring in `ffe-lists` v.3.0.0
275
- - Added support for `medium` and `large` attributes to `DescriptionList`
276
-
277
- ## 1.1.1
278
-
279
- - Upgrade eslint
280
-
281
- # 1.1.0
282
-
283
- - Added className support for ffe-check-list
284
-
285
- # 1.0.0
286
-
287
- - Initial release
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import BulletList from './BulletList';
4
- import BulletListItem from './BulletListItem';
5
-
6
- var getWrapper = function getWrapper(props) {
7
- return shallow( /*#__PURE__*/React.createElement(BulletList, props, /*#__PURE__*/React.createElement(BulletListItem, null, "Firstly"), /*#__PURE__*/React.createElement(BulletListItem, null, "Secondly")));
8
- };
9
-
10
- describe('<BulletList>', function () {
11
- it('renders without exploding', function () {
12
- var wrapper = getWrapper();
13
- expect(wrapper.exists()).toBe(true);
14
- expect(wrapper.is('ul')).toBe(true);
15
- });
16
- it('has the correct class', function () {
17
- var wrapper = getWrapper({
18
- className: 'test-class'
19
- });
20
- expect(wrapper.hasClass('ffe-bullet-list')).toBe(true);
21
- expect(wrapper.hasClass('test-class')).toBe(true);
22
- });
23
- it('passes props', function () {
24
- var wrapper = getWrapper({
25
- id: 'that-id'
26
- });
27
- expect(wrapper.prop('id')).toBe('that-id');
28
- expect(wrapper.html()).toContain('Firstly');
29
- });
30
- it('renders condensed modifier', function () {
31
- var modifierClass = 'ffe-bullet-list--condensed';
32
- expect(getWrapper().hasClass(modifierClass)).toBe(false);
33
- expect(getWrapper({
34
- condensed: true
35
- }).hasClass(modifierClass)).toBe(true);
36
- });
37
- });
@@ -1,60 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import CheckList from './CheckList';
4
- import CheckListItem from './CheckListItem';
5
-
6
- var getWrapper = function getWrapper(props) {
7
- return shallow( /*#__PURE__*/React.createElement(CheckList, props, /*#__PURE__*/React.createElement(CheckListItem, null, "Firstly"), /*#__PURE__*/React.createElement(CheckListItem, null, "Secondly")));
8
- };
9
-
10
- describe('<CheckList>', function () {
11
- it('renders without exploding', function () {
12
- var wrapper = getWrapper();
13
- expect(wrapper.exists()).toBe(true);
14
- expect(wrapper.is('ul')).toBe(true);
15
- });
16
- it('has the correct class', function () {
17
- var wrapper = getWrapper({
18
- className: 'test-class'
19
- });
20
- expect(wrapper.hasClass('ffe-check-list')).toBe(true);
21
- expect(wrapper.hasClass('test-class')).toBe(true);
22
- });
23
- it('passes props', function () {
24
- var wrapper = getWrapper({
25
- id: 'that-id'
26
- });
27
- expect(wrapper.prop('id')).toBe('that-id');
28
- expect(wrapper.html()).toContain('Firstly');
29
- });
30
- it('sets the correct class when columns prop is 2', function () {
31
- var wrapper = getWrapper({
32
- columns: 2
33
- });
34
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(true);
35
- wrapper.setProps({
36
- columns: '2'
37
- });
38
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(true);
39
- });
40
- it('only supports 1 and 2 columns', function () {
41
- var wrapper = getWrapper({
42
- columns: 3
43
- });
44
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(false);
45
- wrapper.setProps({
46
- columns: 1
47
- });
48
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(false);
49
- });
50
- });
51
- describe('<CheckListItem />', function () {
52
- it('sets correct class for isCross flag', function () {
53
- var wrapper = shallow( /*#__PURE__*/React.createElement(CheckListItem, null, "An item"));
54
- expect(wrapper.hasClass('ffe-check-list__item--cross')).toBe(false);
55
- wrapper.setProps({
56
- isCross: true
57
- });
58
- expect(wrapper.hasClass('ffe-check-list__item--cross')).toBe(true);
59
- });
60
- });
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import DescriptionList from './DescriptionList';
4
- import DescriptionListTerm from './DescriptionListTerm';
5
- import DescriptionListDescription from './DescriptionListDescription';
6
-
7
- var getWrapper = function getWrapper(props) {
8
- return shallow( /*#__PURE__*/React.createElement(DescriptionList, props, /*#__PURE__*/React.createElement(DescriptionListTerm, null, "Porsche"), /*#__PURE__*/React.createElement(DescriptionListDescription, null, "German car maker"), /*#__PURE__*/React.createElement(DescriptionListTerm, null, "Toyota"), /*#__PURE__*/React.createElement(DescriptionListDescription, null, "Japanese toy maker")));
9
- };
10
-
11
- describe('<DescriptionList>', function () {
12
- it('renders without exploding', function () {
13
- var wrapper = getWrapper();
14
- expect(wrapper.exists()).toBe(true);
15
- expect(wrapper.is('dl')).toBe(true);
16
- });
17
- it('has the correct class', function () {
18
- var wrapper = getWrapper({
19
- className: 'test-class'
20
- });
21
- expect(wrapper.hasClass('ffe-description-list')).toBe(true);
22
- expect(wrapper.hasClass('test-class')).toBe(true);
23
- });
24
- it('sets the correct class for modifier props', function () {
25
- var wrapper = getWrapper();
26
- expect(wrapper.hasClass('ffe-description-list--md')).toBe(false);
27
- expect(wrapper.hasClass('ffe-description-list--lg')).toBe(false);
28
- wrapper.setProps({
29
- medium: true,
30
- large: false
31
- });
32
- expect(wrapper.hasClass('ffe-description-list--md')).toBe(true);
33
- expect(wrapper.hasClass('ffe-description-list--lg')).toBe(false);
34
- wrapper.setProps({
35
- medium: false,
36
- large: true
37
- });
38
- expect(wrapper.hasClass('ffe-description-list--md')).toBe(false);
39
- expect(wrapper.hasClass('ffe-description-list--lg')).toBe(true);
40
- });
41
- it('passes props', function () {
42
- var wrapper = getWrapper({
43
- id: 'that-id'
44
- });
45
- expect(wrapper.prop('id')).toBe('that-id');
46
- expect(wrapper.html()).toContain('Porsche');
47
- });
48
- });
@@ -1,39 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import DescriptionListMultiCol from './DescriptionListMultiCol';
4
- import DescriptionListTerm from './DescriptionListTerm';
5
- import DescriptionListDescription from './DescriptionListDescription';
6
-
7
- var getWrapper = function getWrapper(props) {
8
- return shallow( /*#__PURE__*/React.createElement(DescriptionListMultiCol, props, /*#__PURE__*/React.createElement(DescriptionListTerm, null, "Porsche"), /*#__PURE__*/React.createElement(DescriptionListDescription, null, "German car maker"), /*#__PURE__*/React.createElement(DescriptionListTerm, null, "Toyota"), /*#__PURE__*/React.createElement(DescriptionListDescription, null, "Japanese toy maker")));
9
- };
10
-
11
- describe('<DescriptionListMultiCol>', function () {
12
- it('renders without exploding', function () {
13
- var wrapper = getWrapper();
14
- expect(wrapper.exists()).toBe(true);
15
- expect(wrapper.is('div')).toBe(true);
16
- });
17
- it('has the correct class', function () {
18
- var wrapper = getWrapper({
19
- className: 'test-class'
20
- });
21
- expect(wrapper.hasClass('ffe-description-list-multicol')).toBe(true);
22
- expect(wrapper.hasClass('test-class')).toBe(true);
23
- });
24
- it('passes props', function () {
25
- var wrapper = getWrapper({
26
- id: 'that-id'
27
- });
28
- expect(wrapper.prop('id')).toBe('that-id');
29
- expect(wrapper.html()).toContain('Porsche');
30
- });
31
- it('wraps pairs in `dl`', function () {
32
- var wrapper = getWrapper();
33
- expect(wrapper.find('.ffe-description-list-multicol__avoid-break').every('dl')).toBe(true);
34
- });
35
- it('supports several columns', function () {
36
- var wrapper = getWrapper();
37
- expect(wrapper.find('.ffe-description-list-multicol__avoid-break')).toHaveLength(2);
38
- });
39
- });
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import NumberedList from './NumberedList';
4
- import NumberedListItem from './NumberedListItem';
5
-
6
- var getWrapper = function getWrapper(props) {
7
- return shallow( /*#__PURE__*/React.createElement(NumberedList, props, /*#__PURE__*/React.createElement(NumberedListItem, null, "Firstly"), /*#__PURE__*/React.createElement(NumberedListItem, null, "Secondly")));
8
- };
9
-
10
- describe('<NumberedList>', function () {
11
- it('renders without exploding', function () {
12
- var wrapper = getWrapper();
13
- expect(wrapper.exists()).toBe(true);
14
- expect(wrapper.is('ol')).toBe(true);
15
- });
16
- it('has the correct class', function () {
17
- var wrapper = getWrapper({
18
- className: 'test-class'
19
- });
20
- expect(wrapper.hasClass('ffe-numbered-list')).toBe(true);
21
- expect(wrapper.hasClass('test-class')).toBe(true);
22
- });
23
- it('passes props', function () {
24
- var wrapper = getWrapper({
25
- id: 'that-id'
26
- });
27
- expect(wrapper.prop('id')).toBe('that-id');
28
- expect(wrapper.html()).toContain('Firstly');
29
- });
30
- it('renders condensed modifier', function () {
31
- var modifierClass = 'ffe-numbered-list--condensed';
32
- expect(getWrapper().hasClass(modifierClass)).toBe(false);
33
- expect(getWrapper({
34
- condensed: true
35
- }).hasClass(modifierClass)).toBe(true);
36
- });
37
- });
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import StylizedNumberedList from './StylizedNumberedList';
4
- import StylizedNumberedListItem from './StylizedNumberedListItem';
5
-
6
- var getWrapper = function getWrapper(props) {
7
- return shallow( /*#__PURE__*/React.createElement(StylizedNumberedList, props, /*#__PURE__*/React.createElement(StylizedNumberedListItem, null, "Firstly"), /*#__PURE__*/React.createElement(StylizedNumberedListItem, null, "Secondly")));
8
- };
9
-
10
- describe('<StylizedNumberedList>', function () {
11
- it('renders without exploding', function () {
12
- var wrapper = getWrapper();
13
- expect(wrapper.exists()).toBe(true);
14
- expect(wrapper.is('ol')).toBe(true);
15
- });
16
- it('has the correct class', function () {
17
- var wrapper = getWrapper({
18
- className: 'test-class'
19
- });
20
- expect(wrapper.hasClass('ffe-stylized-numbered-list')).toBe(true);
21
- expect(wrapper.hasClass('test-class')).toBe(true);
22
- });
23
- it('passes props', function () {
24
- var wrapper = getWrapper({
25
- id: 'that-id'
26
- });
27
- expect(wrapper.prop('id')).toBe('that-id');
28
- expect(wrapper.html()).toContain('Firstly');
29
- });
30
- });
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _enzyme = require("enzyme");
6
-
7
- var _BulletList = _interopRequireDefault(require("./BulletList"));
8
-
9
- var _BulletListItem = _interopRequireDefault(require("./BulletListItem"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- var getWrapper = function getWrapper(props) {
14
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_BulletList.default, props, /*#__PURE__*/_react.default.createElement(_BulletListItem.default, null, "Firstly"), /*#__PURE__*/_react.default.createElement(_BulletListItem.default, null, "Secondly")));
15
- };
16
-
17
- describe('<BulletList>', function () {
18
- it('renders without exploding', function () {
19
- var wrapper = getWrapper();
20
- expect(wrapper.exists()).toBe(true);
21
- expect(wrapper.is('ul')).toBe(true);
22
- });
23
- it('has the correct class', function () {
24
- var wrapper = getWrapper({
25
- className: 'test-class'
26
- });
27
- expect(wrapper.hasClass('ffe-bullet-list')).toBe(true);
28
- expect(wrapper.hasClass('test-class')).toBe(true);
29
- });
30
- it('passes props', function () {
31
- var wrapper = getWrapper({
32
- id: 'that-id'
33
- });
34
- expect(wrapper.prop('id')).toBe('that-id');
35
- expect(wrapper.html()).toContain('Firstly');
36
- });
37
- it('renders condensed modifier', function () {
38
- var modifierClass = 'ffe-bullet-list--condensed';
39
- expect(getWrapper().hasClass(modifierClass)).toBe(false);
40
- expect(getWrapper({
41
- condensed: true
42
- }).hasClass(modifierClass)).toBe(true);
43
- });
44
- });
@@ -1,67 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _enzyme = require("enzyme");
6
-
7
- var _CheckList = _interopRequireDefault(require("./CheckList"));
8
-
9
- var _CheckListItem = _interopRequireDefault(require("./CheckListItem"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- var getWrapper = function getWrapper(props) {
14
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_CheckList.default, props, /*#__PURE__*/_react.default.createElement(_CheckListItem.default, null, "Firstly"), /*#__PURE__*/_react.default.createElement(_CheckListItem.default, null, "Secondly")));
15
- };
16
-
17
- describe('<CheckList>', function () {
18
- it('renders without exploding', function () {
19
- var wrapper = getWrapper();
20
- expect(wrapper.exists()).toBe(true);
21
- expect(wrapper.is('ul')).toBe(true);
22
- });
23
- it('has the correct class', function () {
24
- var wrapper = getWrapper({
25
- className: 'test-class'
26
- });
27
- expect(wrapper.hasClass('ffe-check-list')).toBe(true);
28
- expect(wrapper.hasClass('test-class')).toBe(true);
29
- });
30
- it('passes props', function () {
31
- var wrapper = getWrapper({
32
- id: 'that-id'
33
- });
34
- expect(wrapper.prop('id')).toBe('that-id');
35
- expect(wrapper.html()).toContain('Firstly');
36
- });
37
- it('sets the correct class when columns prop is 2', function () {
38
- var wrapper = getWrapper({
39
- columns: 2
40
- });
41
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(true);
42
- wrapper.setProps({
43
- columns: '2'
44
- });
45
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(true);
46
- });
47
- it('only supports 1 and 2 columns', function () {
48
- var wrapper = getWrapper({
49
- columns: 3
50
- });
51
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(false);
52
- wrapper.setProps({
53
- columns: 1
54
- });
55
- expect(wrapper.hasClass('ffe-check-list--two-columns')).toBe(false);
56
- });
57
- });
58
- describe('<CheckListItem />', function () {
59
- it('sets correct class for isCross flag', function () {
60
- var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_CheckListItem.default, null, "An item"));
61
- expect(wrapper.hasClass('ffe-check-list__item--cross')).toBe(false);
62
- wrapper.setProps({
63
- isCross: true
64
- });
65
- expect(wrapper.hasClass('ffe-check-list__item--cross')).toBe(true);
66
- });
67
- });