@sb1/ffe-lists-react 5.0.2 → 5.0.6

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