@sb1/ffe-lists-react 5.0.0 → 5.0.4

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