@sb1/ffe-spinner-react 5.0.1 → 5.1.1
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.
- package/es/Spinner.js +8 -1
- package/lib/Spinner.js +8 -1
- package/package.json +9 -11
- package/types/index.d.ts +1 -0
- package/CHANGELOG.md +0 -269
- package/es/Spinner.spec.js +0 -34
- package/lib/Spinner.spec.js +0 -40
package/es/Spinner.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["className", "immediate", "large"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
4
|
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -10,11 +12,14 @@ import classNames from 'classnames';
|
|
|
10
12
|
|
|
11
13
|
var Spinner = function Spinner(_ref) {
|
|
12
14
|
var className = _ref.className,
|
|
15
|
+
immediate = _ref.immediate,
|
|
13
16
|
large = _ref.large,
|
|
14
|
-
rest = _objectWithoutProperties(_ref,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
18
|
|
|
16
19
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
17
20
|
className: classNames('ffe-loading-spinner', {
|
|
21
|
+
'ffe-loading-spinner--immediate': immediate
|
|
22
|
+
}, {
|
|
18
23
|
'ffe-loading-spinner--large': large
|
|
19
24
|
}, className)
|
|
20
25
|
}, rest));
|
|
@@ -22,9 +27,11 @@ var Spinner = function Spinner(_ref) {
|
|
|
22
27
|
|
|
23
28
|
Spinner.propTypes = {
|
|
24
29
|
className: string,
|
|
30
|
+
immediate: bool,
|
|
25
31
|
large: bool
|
|
26
32
|
};
|
|
27
33
|
Spinner.defaultProps = {
|
|
34
|
+
immediate: false,
|
|
28
35
|
large: false
|
|
29
36
|
};
|
|
30
37
|
export default Spinner;
|
package/lib/Spinner.js
CHANGED
|
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _excluded = ["className", "immediate", "large"];
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -21,11 +23,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
21
23
|
|
|
22
24
|
var Spinner = function Spinner(_ref) {
|
|
23
25
|
var className = _ref.className,
|
|
26
|
+
immediate = _ref.immediate,
|
|
24
27
|
large = _ref.large,
|
|
25
|
-
rest = _objectWithoutProperties(_ref,
|
|
28
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
29
|
|
|
27
30
|
return /*#__PURE__*/_react.default.createElement("span", _extends({
|
|
28
31
|
className: (0, _classnames.default)('ffe-loading-spinner', {
|
|
32
|
+
'ffe-loading-spinner--immediate': immediate
|
|
33
|
+
}, {
|
|
29
34
|
'ffe-loading-spinner--large': large
|
|
30
35
|
}, className)
|
|
31
36
|
}, rest));
|
|
@@ -33,9 +38,11 @@ var Spinner = function Spinner(_ref) {
|
|
|
33
38
|
|
|
34
39
|
Spinner.propTypes = {
|
|
35
40
|
className: _propTypes.string,
|
|
41
|
+
immediate: _propTypes.bool,
|
|
36
42
|
large: _propTypes.bool
|
|
37
43
|
};
|
|
38
44
|
Spinner.defaultProps = {
|
|
45
|
+
immediate: false,
|
|
39
46
|
large: false
|
|
40
47
|
};
|
|
41
48
|
var _default = Spinner;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-spinner-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "SpareBank 1",
|
|
6
6
|
"files": [
|
|
@@ -17,11 +17,8 @@
|
|
|
17
17
|
"url": "ssh://git@github.com:SpareBank1/designsystem.git"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "
|
|
21
|
-
"
|
|
22
|
-
"build:es": "babel -d es/. --root-mode=upward --env-name=es --ignore=*.spec.js src/.",
|
|
23
|
-
"build:types": "copyfiles -f src/index.d.ts types/",
|
|
24
|
-
"lint": "eslint src/.",
|
|
20
|
+
"build": "ffe-buildtool babel",
|
|
21
|
+
"lint": "eslint src",
|
|
25
22
|
"test": "jest",
|
|
26
23
|
"test:watch": "jest --watch"
|
|
27
24
|
},
|
|
@@ -29,21 +26,22 @@
|
|
|
29
26
|
"setupTestFrameworkScriptFile": "../../test-setup.js"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
|
-
"prop-types": "^15.
|
|
29
|
+
"prop-types": "^15.7.2"
|
|
33
30
|
},
|
|
34
31
|
"devDependencies": {
|
|
32
|
+
"@sb1/ffe-buildtool": "^0.1.0",
|
|
35
33
|
"enzyme": "^3.7.0",
|
|
36
34
|
"enzyme-adapter-react-16": "^1.7.0",
|
|
37
|
-
"jest": "^
|
|
35
|
+
"jest": "^26.0.0",
|
|
38
36
|
"react": "^16.9.0",
|
|
39
37
|
"react-dom": "^16.9.0"
|
|
40
38
|
},
|
|
41
39
|
"peerDependencies": {
|
|
42
|
-
"@sb1/ffe-spinner": "
|
|
43
|
-
"react": "
|
|
40
|
+
"@sb1/ffe-spinner": "*",
|
|
41
|
+
"react": ">=16.9.0"
|
|
44
42
|
},
|
|
45
43
|
"publishConfig": {
|
|
46
44
|
"access": "public"
|
|
47
45
|
},
|
|
48
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "59eb2e12625e744f1a116c14a40cf69f1bbecdc6"
|
|
49
47
|
}
|
package/types/index.d.ts
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,269 +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-spinner-react@5.0.0...@sb1/ffe-spinner-react@5.0.1) (2021-02-02)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* **ffe-spinner-react:** reduce vulnerabilities ([c502167](https://github.com/SpareBank1/designsystem/commit/c502167b80add31dae531e466a7c03e549ed740a))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# [5.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.1.1...@sb1/ffe-spinner-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.1.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.1.0...@sb1/ffe-spinner-react@4.1.1) (2019-04-26)
|
|
31
|
-
|
|
32
|
-
### Bug Fixes
|
|
33
|
-
|
|
34
|
-
- **ffe-spinner-react:** Fixed missing default export in typescript definitions ([82a2df2](https://github.com/SpareBank1/designsystem/commit/82a2df2))
|
|
35
|
-
|
|
36
|
-
# [4.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.6...@sb1/ffe-spinner-react@4.1.0) (2019-04-25)
|
|
37
|
-
|
|
38
|
-
### Features
|
|
39
|
-
|
|
40
|
-
- **ffe-spinner-react:** Added type definitions for typescript ([12cccd5](https://github.com/SpareBank1/designsystem/commit/12cccd5))
|
|
41
|
-
- **ffe-spinner-react:** Added type definitions for typescript ([e528654](https://github.com/SpareBank1/designsystem/commit/e528654))
|
|
42
|
-
|
|
43
|
-
## [4.0.6](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.5...@sb1/ffe-spinner-react@4.0.6) (2018-12-11)
|
|
44
|
-
|
|
45
|
-
### Bug Fixes
|
|
46
|
-
|
|
47
|
-
- Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
|
|
48
|
-
|
|
49
|
-
## [4.0.5](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.4...@sb1/ffe-spinner-react@4.0.5) (2018-11-26)
|
|
50
|
-
|
|
51
|
-
**Note:** Version bump only for package @sb1/ffe-spinner-react
|
|
52
|
-
|
|
53
|
-
<a name="4.0.4"></a>
|
|
54
|
-
|
|
55
|
-
## [4.0.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.3...@sb1/ffe-spinner-react@4.0.4) (2018-08-09)
|
|
56
|
-
|
|
57
|
-
**Note:** Version bump only for package @sb1/ffe-spinner-react
|
|
58
|
-
|
|
59
|
-
<a name="4.0.3"></a>
|
|
60
|
-
|
|
61
|
-
## [4.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.2...@sb1/ffe-spinner-react@4.0.3) (2018-03-27)
|
|
62
|
-
|
|
63
|
-
**Note:** Version bump only for package @sb1/ffe-spinner-react
|
|
64
|
-
|
|
65
|
-
<a name="4.0.2"></a>
|
|
66
|
-
|
|
67
|
-
## [4.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.0...@sb1/ffe-spinner-react@4.0.2) (2018-03-07)
|
|
68
|
-
|
|
69
|
-
### Bug Fixes
|
|
70
|
-
|
|
71
|
-
- Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
|
|
72
|
-
|
|
73
|
-
<a name="4.0.1"></a>
|
|
74
|
-
|
|
75
|
-
## [4.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-spinner-react@4.0.0...@sb1/ffe-spinner-react@4.0.1) (2018-03-02)
|
|
76
|
-
|
|
77
|
-
### Bug Fixes
|
|
78
|
-
|
|
79
|
-
- Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
|
|
80
|
-
|
|
81
|
-
<a name="4.0.0"></a>
|
|
82
|
-
|
|
83
|
-
# 4.0.0 (2018-02-25)
|
|
84
|
-
|
|
85
|
-
### Chores
|
|
86
|
-
|
|
87
|
-
- **ffe-spinner-react:** Reimplement ffe-spinner-react ([f3f8795](https://github.com/SpareBank1/designsystem/commit/f3f8795))
|
|
88
|
-
- add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
|
|
89
|
-
|
|
90
|
-
### BREAKING CHANGES
|
|
91
|
-
|
|
92
|
-
- All packages have been renamed to add the @sb1 scope.
|
|
93
|
-
|
|
94
|
-
See links [1] and [2] to read more about package scopes.
|
|
95
|
-
|
|
96
|
-
Unfortunately this requires you update both your dependencies in
|
|
97
|
-
`package.json` and all `import` or `require` statements in your code.
|
|
98
|
-
Also, you unfortunately have to upgrade all FFE packages at once due to
|
|
99
|
-
dependency between packages. If you are on the latest version prior to
|
|
100
|
-
this breaking change the upgrade should be a matter of updating
|
|
101
|
-
`package.json` with new package names and versions, and updating your
|
|
102
|
-
imports.
|
|
103
|
-
|
|
104
|
-
To help find the proper package versions you can either browse to the
|
|
105
|
-
packages you need or check out the list of Git tags either on
|
|
106
|
-
Github [3] or by cloning the repository and running the `git tag`
|
|
107
|
-
command. All package versions get a tag in the format
|
|
108
|
-
_package@version_.
|
|
109
|
-
|
|
110
|
-
Update your `package.json` with the latest package version and add the
|
|
111
|
-
@sb1 scope to the package name:
|
|
112
|
-
|
|
113
|
-
```diff
|
|
114
|
-
- "ffe-core": "11.0.2",
|
|
115
|
-
+ "@sb1/ffe-core": "11.0.2",
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Scoped packages all get put in a subdirectory in `node_modules/`. In our
|
|
119
|
-
case packages will be put in the `node_modules/@sb1/` directory. If your
|
|
120
|
-
build depends on file paths (for instance for copying fonts) you need to
|
|
121
|
-
update that path to include the scope.
|
|
122
|
-
|
|
123
|
-
The directory structure also means you have to update your imports, both
|
|
124
|
-
in Less and in JavaScript.
|
|
125
|
-
|
|
126
|
-
Using `less-plugin-npm-import`:
|
|
127
|
-
|
|
128
|
-
```diff
|
|
129
|
-
- @import 'npm://ffe-core/less/ffe';
|
|
130
|
-
+ @import 'npm://@sb1/ffe-core/less/ffe';
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Using Webpack:
|
|
134
|
-
|
|
135
|
-
```diff
|
|
136
|
-
- @import '~ffe-core/less/ffe';
|
|
137
|
-
+ @import '~@sb1/ffe-core/less/ffe';
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Using plain old paths:
|
|
141
|
-
|
|
142
|
-
```diff
|
|
143
|
-
- @import '../path/to/node_modules/ffe-core/less/ffe';
|
|
144
|
-
+ @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
JavaScript `import`:
|
|
148
|
-
|
|
149
|
-
```diff
|
|
150
|
-
- import { ActionButton } from 'ffe-buttons-react';
|
|
151
|
-
+ import { ActionButton } from '@sb1/ffe-buttons-react';
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
JavaScript `require`:
|
|
155
|
-
|
|
156
|
-
```diff
|
|
157
|
-
- const { ActionButton } = require('ffe-buttons-react').default;
|
|
158
|
-
+ const { ActionButton } = require('@sb1/ffe-buttons-react').default;
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
[1]: https://docs.npmjs.com/misc/scope
|
|
162
|
-
[2]: https://docs.npmjs.com/getting-started/scoped-packages
|
|
163
|
-
[3]: https://github.com/sparebank1/designsystem/tags
|
|
164
|
-
|
|
165
|
-
- **ffe-spinner-react:** This commit reimplements and simplifies the
|
|
166
|
-
ffe-spinner-react implementation. It no longer includes layout, which
|
|
167
|
-
requires the consumer to place it correctly.
|
|
168
|
-
|
|
169
|
-
The `<InlineSpinner />` and `<LargeSpinner />` are now available as
|
|
170
|
-
`<Spinner large={true|false} />`.
|
|
171
|
-
|
|
172
|
-
The previous `<Spinner />` implementation, which wrapped a large
|
|
173
|
-
spinner in a `ffe-content-container` class is now removed. To keep this
|
|
174
|
-
behavior, the consumer can create its own implementation of a
|
|
175
|
-
`<SpinnerWithLayout />` or something similar.
|
|
176
|
-
|
|
177
|
-
<a name="3.0.6"></a>
|
|
178
|
-
|
|
179
|
-
## [3.0.6](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.5...ffe-spinner-react@3.0.6) (2018-02-23)
|
|
180
|
-
|
|
181
|
-
**Note:** Version bump only for package ffe-spinner-react
|
|
182
|
-
|
|
183
|
-
<a name="3.0.5"></a>
|
|
184
|
-
|
|
185
|
-
## [3.0.5](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.4...ffe-spinner-react@3.0.5) (2018-02-22)
|
|
186
|
-
|
|
187
|
-
**Note:** Version bump only for package ffe-spinner-react
|
|
188
|
-
|
|
189
|
-
<a name="3.0.4"></a>
|
|
190
|
-
|
|
191
|
-
## [3.0.4](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.3...ffe-spinner-react@3.0.4) (2018-02-20)
|
|
192
|
-
|
|
193
|
-
**Note:** Version bump only for package ffe-spinner-react
|
|
194
|
-
|
|
195
|
-
<a name="3.0.3"></a>
|
|
196
|
-
|
|
197
|
-
## [3.0.3](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.2...ffe-spinner-react@3.0.3) (2018-02-15)
|
|
198
|
-
|
|
199
|
-
**Note:** Version bump only for package ffe-spinner-react
|
|
200
|
-
|
|
201
|
-
<a name="3.0.2"></a>
|
|
202
|
-
|
|
203
|
-
## [3.0.2](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.1...ffe-spinner-react@3.0.2) (2018-02-01)
|
|
204
|
-
|
|
205
|
-
**Note:** Version bump only for package ffe-spinner-react
|
|
206
|
-
|
|
207
|
-
<a name="3.0.1"></a>
|
|
208
|
-
|
|
209
|
-
## [3.0.1](https://github.com/SpareBank1/designsystem/compare/ffe-spinner-react@3.0.0...ffe-spinner-react@3.0.1) (2018-01-22)
|
|
210
|
-
|
|
211
|
-
**Note:** Version bump only for package ffe-spinner-react
|
|
212
|
-
|
|
213
|
-
<a name="3.0.0"></a>
|
|
214
|
-
|
|
215
|
-
# 3.0.0 (2018-01-22)
|
|
216
|
-
|
|
217
|
-
### Chores
|
|
218
|
-
|
|
219
|
-
- **ffe-spinner-react:** Reimplement ffe-spinner-react
|
|
220
|
-
|
|
221
|
-
### BREAKING CHANGES
|
|
222
|
-
|
|
223
|
-
- **ffe-spinner-react:** This commit reimplements and simplifies the
|
|
224
|
-
ffe-spinner-react implementation. It no longer includes layout, which
|
|
225
|
-
requires the consumer to place it correctly.
|
|
226
|
-
|
|
227
|
-
The `<InlineSpinner />` and `<LargeSpinner />` are now available as
|
|
228
|
-
`<Spinner large={true|false} />`.
|
|
229
|
-
|
|
230
|
-
The previous `<Spinner />` implementation, which wrapped a large
|
|
231
|
-
spinner in a `ffe-content-container` class is now removed. To keep this
|
|
232
|
-
behavior, the consumer can create its own implementation of a
|
|
233
|
-
`<SpinnerWithLayout />` or something similar.
|
|
234
|
-
|
|
235
|
-
## 2.0.4
|
|
236
|
-
|
|
237
|
-
- Document and refactor internally.
|
|
238
|
-
- Deprecate `text` prop in favor of `children`
|
|
239
|
-
|
|
240
|
-
## 2.0.3
|
|
241
|
-
|
|
242
|
-
- Use PropTypes from prop-types package
|
|
243
|
-
|
|
244
|
-
## 2.0.2
|
|
245
|
-
|
|
246
|
-
- Expand peerDep scope of `ffe-spinner` to include `2.x`.
|
|
247
|
-
- Remove peerDep on `ffe-core`.
|
|
248
|
-
|
|
249
|
-
## 2.0.1
|
|
250
|
-
|
|
251
|
-
- Upgrade eslint to use latest ffe config
|
|
252
|
-
|
|
253
|
-
# 2.0.0
|
|
254
|
-
|
|
255
|
-
- peerDependency on `ffe-core` bumped to `^8.0.2`
|
|
256
|
-
- Added explicit dependency on `ffe-core` and `ffe-spinner`
|
|
257
|
-
- Added a budo example page that can be launched with `npm start`
|
|
258
|
-
|
|
259
|
-
## 1.0.2
|
|
260
|
-
|
|
261
|
-
- peerDependency on `ffe-core` relaxed to `^6.0.0`
|
|
262
|
-
|
|
263
|
-
## 1.0.1
|
|
264
|
-
|
|
265
|
-
- peerDependency on `ffe-core` relaxed to `^5.0.0`
|
|
266
|
-
|
|
267
|
-
# 1.0.0
|
|
268
|
-
|
|
269
|
-
- Initial release
|
package/es/Spinner.spec.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import Spinner from '.';
|
|
4
|
-
|
|
5
|
-
var getWrapper = function getWrapper(props) {
|
|
6
|
-
return shallow( /*#__PURE__*/React.createElement(Spinner, props));
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
describe('<Spinner />', function () {
|
|
10
|
-
it('renders without exploding', function () {
|
|
11
|
-
var wrapper = getWrapper();
|
|
12
|
-
expect(wrapper.exists()).toBe(true);
|
|
13
|
-
expect(wrapper.is('span')).toBe(true);
|
|
14
|
-
});
|
|
15
|
-
it('renders classes correctly', function () {
|
|
16
|
-
var wrapper = getWrapper({
|
|
17
|
-
className: 'test-class'
|
|
18
|
-
});
|
|
19
|
-
expect(wrapper.hasClass('ffe-loading-spinner')).toBe(true);
|
|
20
|
-
expect(wrapper.hasClass('test-class')).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
it('renders a large spinner', function () {
|
|
23
|
-
var wrapper = getWrapper({
|
|
24
|
-
large: true
|
|
25
|
-
});
|
|
26
|
-
expect(wrapper.hasClass('ffe-loading-spinner--large')).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
it('passes props correctly', function () {
|
|
29
|
-
var wrapper = getWrapper({
|
|
30
|
-
id: 'test-id'
|
|
31
|
-
});
|
|
32
|
-
expect(wrapper.prop('id')).toBe('test-id');
|
|
33
|
-
});
|
|
34
|
-
});
|
package/lib/Spinner.spec.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
|
|
5
|
-
var _enzyme = require("enzyme");
|
|
6
|
-
|
|
7
|
-
var _ = _interopRequireDefault(require("."));
|
|
8
|
-
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
var getWrapper = function getWrapper(props) {
|
|
12
|
-
return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, props));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
describe('<Spinner />', function () {
|
|
16
|
-
it('renders without exploding', function () {
|
|
17
|
-
var wrapper = getWrapper();
|
|
18
|
-
expect(wrapper.exists()).toBe(true);
|
|
19
|
-
expect(wrapper.is('span')).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
it('renders classes correctly', function () {
|
|
22
|
-
var wrapper = getWrapper({
|
|
23
|
-
className: 'test-class'
|
|
24
|
-
});
|
|
25
|
-
expect(wrapper.hasClass('ffe-loading-spinner')).toBe(true);
|
|
26
|
-
expect(wrapper.hasClass('test-class')).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
it('renders a large spinner', function () {
|
|
29
|
-
var wrapper = getWrapper({
|
|
30
|
-
large: true
|
|
31
|
-
});
|
|
32
|
-
expect(wrapper.hasClass('ffe-loading-spinner--large')).toBe(true);
|
|
33
|
-
});
|
|
34
|
-
it('passes props correctly', function () {
|
|
35
|
-
var wrapper = getWrapper({
|
|
36
|
-
id: 'test-id'
|
|
37
|
-
});
|
|
38
|
-
expect(wrapper.prop('id')).toBe('test-id');
|
|
39
|
-
});
|
|
40
|
-
});
|