@sb1/ffe-lists-react 5.0.3 → 5.0.7

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