@gympass/yoga 7.86.0 → 7.87.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/cjs/Avatar/native/Avatar.js +1 -1
- package/cjs/Button/web/Button.js +26 -4
- package/cjs/Button/web/Icon.js +17 -7
- package/cjs/Button/web/Link.js +15 -12
- package/cjs/Button/web/Outline.js +2 -1
- package/cjs/Button/web/StyledButton.js +2 -1
- package/cjs/Button/web/Text.js +34 -1
- package/cjs/Spinner/web/Spinner.js +3 -2
- package/esm/Avatar/native/Avatar.js +14 -17
- package/esm/Button/web/Button.js +22 -4
- package/esm/Button/web/Button.test.js +1188 -585
- package/esm/Button/web/Icon.js +16 -7
- package/esm/Button/web/Link.js +11 -12
- package/esm/Button/web/Outline.js +2 -1
- package/esm/Button/web/StyledButton.js +2 -1
- package/esm/Button/web/Text.js +28 -1
- package/esm/Spinner/web/Spinner.js +3 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, fireEvent } from '@testing-library/react';
|
|
2
|
+
import { render, fireEvent, screen, within } from '@testing-library/react';
|
|
3
3
|
import { Booking, Close } from '@gympass/yoga-icons';
|
|
4
4
|
import ThemeProvider from '../../Theme';
|
|
5
5
|
import Button from '..';
|
|
@@ -21,140 +21,141 @@ describe('<Button />', function () {
|
|
|
21
21
|
|
|
22
22
|
expect(container).toMatchSnapshot();
|
|
23
23
|
});
|
|
24
|
-
it('should match snapshot with
|
|
25
|
-
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button
|
|
24
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
25
|
+
var _render3 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
isLoading: true
|
|
27
|
+
}))),
|
|
26
28
|
container = _render3.container;
|
|
27
29
|
|
|
28
30
|
expect(container).toMatchSnapshot();
|
|
29
31
|
});
|
|
30
|
-
it('should match snapshot with
|
|
31
|
-
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button
|
|
32
|
-
icon: Booking
|
|
32
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
33
|
+
var _render4 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
icon: Booking,
|
|
35
|
+
isLoading: true
|
|
33
36
|
}))),
|
|
34
37
|
container = _render4.container;
|
|
35
38
|
|
|
36
39
|
expect(container).toMatchSnapshot();
|
|
37
40
|
});
|
|
38
|
-
it('should match snapshot with
|
|
39
|
-
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
41
|
+
it('should match snapshot with outline Button', function () {
|
|
42
|
+
var _render5 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, null))),
|
|
40
43
|
container = _render5.container;
|
|
41
44
|
|
|
42
45
|
expect(container).toMatchSnapshot();
|
|
43
46
|
});
|
|
44
|
-
it('should match snapshot with
|
|
45
|
-
var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
47
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
48
|
+
var _render6 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
46
49
|
icon: Booking
|
|
47
50
|
}))),
|
|
48
51
|
container = _render6.container;
|
|
49
52
|
|
|
50
53
|
expect(container).toMatchSnapshot();
|
|
51
54
|
});
|
|
52
|
-
it('should match snapshot with
|
|
53
|
-
var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
55
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
56
|
+
var _render7 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
57
|
+
isLoading: true
|
|
58
|
+
}))),
|
|
54
59
|
container = _render7.container;
|
|
55
60
|
|
|
56
61
|
expect(container).toMatchSnapshot();
|
|
57
62
|
});
|
|
58
|
-
it('should match snapshot with
|
|
59
|
-
var _render8 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button
|
|
60
|
-
icon: Booking
|
|
63
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
64
|
+
var _render8 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
65
|
+
icon: Booking,
|
|
66
|
+
isLoading: true
|
|
61
67
|
}))),
|
|
62
68
|
container = _render8.container;
|
|
63
69
|
|
|
64
70
|
expect(container).toMatchSnapshot();
|
|
65
71
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
it('should match snapshot with default Button', function () {
|
|
69
|
-
var _render9 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
70
|
-
inverted: true
|
|
71
|
-
}))),
|
|
72
|
+
it('should match snapshot with text Button', function () {
|
|
73
|
+
var _render9 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, null))),
|
|
72
74
|
container = _render9.container;
|
|
73
75
|
|
|
74
76
|
expect(container).toMatchSnapshot();
|
|
75
77
|
});
|
|
76
|
-
it('should match snapshot with
|
|
77
|
-
var _render10 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
78
|
-
inverted: true,
|
|
78
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
79
|
+
var _render10 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
79
80
|
icon: Booking
|
|
80
81
|
}))),
|
|
81
82
|
container = _render10.container;
|
|
82
83
|
|
|
83
84
|
expect(container).toMatchSnapshot();
|
|
84
85
|
});
|
|
85
|
-
it('should match snapshot with
|
|
86
|
-
var _render11 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
87
|
-
inverted: true
|
|
88
|
-
}))),
|
|
86
|
+
it('should match snapshot with link Button', function () {
|
|
87
|
+
var _render11 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, null))),
|
|
89
88
|
container = _render11.container;
|
|
90
89
|
|
|
91
90
|
expect(container).toMatchSnapshot();
|
|
92
91
|
});
|
|
93
|
-
it('should match snapshot with
|
|
94
|
-
var _render12 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
95
|
-
inverted: true,
|
|
92
|
+
it('should match snapshot with icon Button', function () {
|
|
93
|
+
var _render12 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
96
94
|
icon: Booking
|
|
97
95
|
}))),
|
|
98
96
|
container = _render12.container;
|
|
99
97
|
|
|
100
98
|
expect(container).toMatchSnapshot();
|
|
101
99
|
});
|
|
102
|
-
it('should match snapshot with text
|
|
103
|
-
var _render13 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
104
|
-
|
|
100
|
+
it('should match snapshot with text icon and Loading', function () {
|
|
101
|
+
var _render13 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
102
|
+
icon: Booking,
|
|
103
|
+
isLoading: true
|
|
105
104
|
}))),
|
|
106
105
|
container = _render13.container;
|
|
107
106
|
|
|
108
107
|
expect(container).toMatchSnapshot();
|
|
109
108
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
});
|
|
110
|
+
describe('With inverted prop', function () {
|
|
111
|
+
it('should match snapshot with default Button', function () {
|
|
112
|
+
var _render14 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
113
|
+
inverted: true
|
|
114
114
|
}))),
|
|
115
115
|
container = _render14.container;
|
|
116
116
|
|
|
117
117
|
expect(container).toMatchSnapshot();
|
|
118
118
|
});
|
|
119
|
-
it('should match snapshot with
|
|
120
|
-
var _render15 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button
|
|
119
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
120
|
+
var _render15 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
121
121
|
inverted: true,
|
|
122
|
-
|
|
122
|
+
isLoading: true
|
|
123
123
|
}))),
|
|
124
124
|
container = _render15.container;
|
|
125
125
|
|
|
126
126
|
expect(container).toMatchSnapshot();
|
|
127
127
|
});
|
|
128
|
-
|
|
129
|
-
describe('With small prop', function () {
|
|
130
|
-
it('should match snapshot with default Button', function () {
|
|
128
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
131
129
|
var _render16 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
132
|
-
|
|
130
|
+
inverted: true,
|
|
131
|
+
icon: Booking
|
|
133
132
|
}))),
|
|
134
133
|
container = _render16.container;
|
|
135
134
|
|
|
136
135
|
expect(container).toMatchSnapshot();
|
|
137
136
|
});
|
|
138
|
-
it('should match snapshot with
|
|
139
|
-
var _render17 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button
|
|
140
|
-
|
|
137
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
138
|
+
var _render17 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
139
|
+
inverted: true,
|
|
140
|
+
icon: Booking,
|
|
141
|
+
isLoading: true
|
|
141
142
|
}))),
|
|
142
143
|
container = _render17.container;
|
|
143
144
|
|
|
144
145
|
expect(container).toMatchSnapshot();
|
|
145
146
|
});
|
|
146
|
-
it('should match snapshot with
|
|
147
|
-
var _render18 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
148
|
-
|
|
147
|
+
it('should match snapshot with outline Button', function () {
|
|
148
|
+
var _render18 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
149
|
+
inverted: true
|
|
149
150
|
}))),
|
|
150
151
|
container = _render18.container;
|
|
151
152
|
|
|
152
153
|
expect(container).toMatchSnapshot();
|
|
153
154
|
});
|
|
154
|
-
it('should match snapshot with
|
|
155
|
-
var _render19 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
156
|
+
var _render19 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
157
|
+
inverted: true,
|
|
158
|
+
isLoading: true
|
|
158
159
|
}))),
|
|
159
160
|
container = _render19.container;
|
|
160
161
|
|
|
@@ -162,611 +163,1213 @@ describe('<Button />', function () {
|
|
|
162
163
|
});
|
|
163
164
|
it('should match snapshot with outline Button with Icon', function () {
|
|
164
165
|
var _render20 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
inverted: true,
|
|
167
|
+
icon: Booking
|
|
167
168
|
}))),
|
|
168
169
|
container = _render20.container;
|
|
169
170
|
|
|
170
171
|
expect(container).toMatchSnapshot();
|
|
171
172
|
});
|
|
172
|
-
it('should match snapshot with
|
|
173
|
-
var _render21 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
173
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
174
|
+
var _render21 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
175
|
+
inverted: true,
|
|
174
176
|
icon: Booking,
|
|
175
|
-
|
|
177
|
+
isLoading: true
|
|
176
178
|
}))),
|
|
177
179
|
container = _render21.container;
|
|
178
180
|
|
|
179
181
|
expect(container).toMatchSnapshot();
|
|
180
182
|
});
|
|
181
|
-
it('should match snapshot with
|
|
182
|
-
var _render22 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
183
|
-
|
|
184
|
-
small: true
|
|
183
|
+
it('should match snapshot with text Button', function () {
|
|
184
|
+
var _render22 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
185
|
+
inverted: true
|
|
185
186
|
}))),
|
|
186
187
|
container = _render22.container;
|
|
187
188
|
|
|
188
189
|
expect(container).toMatchSnapshot();
|
|
189
190
|
});
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
full: true
|
|
191
|
+
it('should match snapshot with icon Button', function () {
|
|
192
|
+
var _render23 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
193
|
+
inverted: true,
|
|
194
|
+
icon: Booking
|
|
195
195
|
}))),
|
|
196
196
|
container = _render23.container;
|
|
197
197
|
|
|
198
198
|
expect(container).toMatchSnapshot();
|
|
199
199
|
});
|
|
200
|
-
it('should match snapshot with
|
|
201
|
-
var _render24 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.
|
|
202
|
-
|
|
200
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
201
|
+
var _render24 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
202
|
+
inverted: true,
|
|
203
|
+
icon: Booking,
|
|
204
|
+
isLoading: true
|
|
203
205
|
}))),
|
|
204
206
|
container = _render24.container;
|
|
205
207
|
|
|
206
208
|
expect(container).toMatchSnapshot();
|
|
207
209
|
});
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
210
|
+
describe('With small prop', function () {
|
|
211
|
+
it('should match snapshot with default Button', function () {
|
|
212
|
+
var _render25 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
213
|
+
small: true
|
|
214
|
+
}))),
|
|
215
|
+
container = _render25.container;
|
|
216
|
+
|
|
217
|
+
expect(container).toMatchSnapshot();
|
|
218
|
+
});
|
|
219
|
+
it('should match snapshot with default Button when is Loading', function () {
|
|
220
|
+
var _render26 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
221
|
+
small: true,
|
|
222
|
+
isLoading: true
|
|
223
|
+
}))),
|
|
224
|
+
container = _render26.container;
|
|
225
|
+
|
|
226
|
+
expect(container).toMatchSnapshot();
|
|
227
|
+
});
|
|
228
|
+
it('should match snapshot with outline Button', function () {
|
|
229
|
+
var _render27 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
230
|
+
small: true
|
|
231
|
+
}))),
|
|
232
|
+
container = _render27.container;
|
|
233
|
+
|
|
234
|
+
expect(container).toMatchSnapshot();
|
|
235
|
+
});
|
|
236
|
+
it('should match snapshot with outline Button when is Loading', function () {
|
|
237
|
+
var _render28 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
238
|
+
small: true,
|
|
239
|
+
isLoading: true
|
|
240
|
+
}))),
|
|
241
|
+
container = _render28.container;
|
|
242
|
+
|
|
243
|
+
expect(container).toMatchSnapshot();
|
|
244
|
+
});
|
|
245
|
+
it('should match snapshot with text Button', function () {
|
|
246
|
+
var _render29 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
247
|
+
small: true
|
|
248
|
+
}))),
|
|
249
|
+
container = _render29.container;
|
|
250
|
+
|
|
251
|
+
expect(container).toMatchSnapshot();
|
|
252
|
+
});
|
|
253
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
254
|
+
var _render30 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
255
|
+
small: true,
|
|
256
|
+
icon: Booking
|
|
257
|
+
}))),
|
|
258
|
+
container = _render30.container;
|
|
259
|
+
|
|
260
|
+
expect(container).toMatchSnapshot();
|
|
261
|
+
});
|
|
262
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
263
|
+
var _render31 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
264
|
+
small: true,
|
|
265
|
+
icon: Booking,
|
|
266
|
+
isLoading: true
|
|
267
|
+
}))),
|
|
268
|
+
container = _render31.container;
|
|
269
|
+
|
|
270
|
+
expect(container).toMatchSnapshot();
|
|
271
|
+
});
|
|
272
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
273
|
+
var _render32 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
274
|
+
icon: Booking,
|
|
275
|
+
small: true
|
|
276
|
+
}))),
|
|
277
|
+
container = _render32.container;
|
|
278
|
+
|
|
279
|
+
expect(container).toMatchSnapshot();
|
|
280
|
+
});
|
|
281
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
282
|
+
var _render33 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
283
|
+
icon: Booking,
|
|
284
|
+
small: true,
|
|
285
|
+
isLoading: true
|
|
286
|
+
}))),
|
|
287
|
+
container = _render33.container;
|
|
288
|
+
|
|
289
|
+
expect(container).toMatchSnapshot();
|
|
290
|
+
});
|
|
291
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
292
|
+
var _render34 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
293
|
+
icon: Booking,
|
|
294
|
+
small: true
|
|
295
|
+
}))),
|
|
296
|
+
container = _render34.container;
|
|
297
|
+
|
|
298
|
+
expect(container).toMatchSnapshot();
|
|
299
|
+
});
|
|
300
|
+
it('should match snapshot with icon Button', function () {
|
|
301
|
+
var _render35 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
302
|
+
icon: Booking,
|
|
303
|
+
small: true
|
|
304
|
+
}))),
|
|
305
|
+
container = _render35.container;
|
|
306
|
+
|
|
307
|
+
expect(container).toMatchSnapshot();
|
|
308
|
+
});
|
|
309
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
310
|
+
var _render36 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
311
|
+
icon: Booking,
|
|
312
|
+
small: true,
|
|
313
|
+
isLoading: true
|
|
314
|
+
}))),
|
|
315
|
+
container = _render36.container;
|
|
316
|
+
|
|
317
|
+
expect(container).toMatchSnapshot();
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
describe('With full prop', function () {
|
|
321
|
+
it('should match snapshot with default Button', function () {
|
|
322
|
+
var _render37 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
323
|
+
full: true
|
|
324
|
+
}))),
|
|
325
|
+
container = _render37.container;
|
|
326
|
+
|
|
327
|
+
expect(container).toMatchSnapshot();
|
|
328
|
+
});
|
|
329
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
330
|
+
var _render38 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
331
|
+
full: true,
|
|
332
|
+
isLoading: true
|
|
333
|
+
}))),
|
|
334
|
+
container = _render38.container;
|
|
335
|
+
|
|
336
|
+
expect(container).toMatchSnapshot();
|
|
337
|
+
});
|
|
338
|
+
it('should match snapshot with outline Button', function () {
|
|
339
|
+
var _render39 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
340
|
+
full: true
|
|
341
|
+
}))),
|
|
342
|
+
container = _render39.container;
|
|
343
|
+
|
|
344
|
+
expect(container).toMatchSnapshot();
|
|
345
|
+
});
|
|
346
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
347
|
+
var _render40 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
348
|
+
full: true,
|
|
349
|
+
isLoading: true
|
|
350
|
+
}))),
|
|
351
|
+
container = _render40.container;
|
|
352
|
+
|
|
353
|
+
expect(container).toMatchSnapshot();
|
|
354
|
+
});
|
|
355
|
+
it('should match snapshot with text Button', function () {
|
|
356
|
+
var _render41 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
357
|
+
full: true
|
|
358
|
+
}))),
|
|
359
|
+
container = _render41.container;
|
|
360
|
+
|
|
361
|
+
expect(container).toMatchSnapshot();
|
|
362
|
+
});
|
|
363
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
364
|
+
var _render42 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
365
|
+
full: true,
|
|
366
|
+
icon: Booking
|
|
367
|
+
}))),
|
|
368
|
+
container = _render42.container;
|
|
369
|
+
|
|
370
|
+
expect(container).toMatchSnapshot();
|
|
371
|
+
});
|
|
372
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
373
|
+
var _render43 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
374
|
+
full: true,
|
|
375
|
+
icon: Booking,
|
|
376
|
+
isLoading: true
|
|
377
|
+
}))),
|
|
378
|
+
container = _render43.container;
|
|
379
|
+
|
|
380
|
+
expect(container).toMatchSnapshot();
|
|
381
|
+
});
|
|
382
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
383
|
+
var _render44 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
384
|
+
full: true,
|
|
385
|
+
icon: Booking
|
|
386
|
+
}))),
|
|
387
|
+
container = _render44.container;
|
|
388
|
+
|
|
389
|
+
expect(container).toMatchSnapshot();
|
|
390
|
+
});
|
|
391
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
392
|
+
var _render45 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
393
|
+
full: true,
|
|
394
|
+
icon: Booking,
|
|
395
|
+
isLoading: true
|
|
396
|
+
}))),
|
|
397
|
+
container = _render45.container;
|
|
398
|
+
|
|
399
|
+
expect(container).toMatchSnapshot();
|
|
400
|
+
});
|
|
401
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
402
|
+
var _render46 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
403
|
+
full: true,
|
|
404
|
+
icon: Booking
|
|
405
|
+
}))),
|
|
406
|
+
container = _render46.container;
|
|
407
|
+
|
|
408
|
+
expect(container).toMatchSnapshot();
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
describe('With disabled prop', function () {
|
|
412
|
+
it('should match snapshot with default Button', function () {
|
|
413
|
+
var _render47 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
414
|
+
disabled: true
|
|
415
|
+
}))),
|
|
416
|
+
container = _render47.container;
|
|
417
|
+
|
|
418
|
+
expect(container).toMatchSnapshot();
|
|
419
|
+
});
|
|
420
|
+
it('should match snapshot with default Button', function () {
|
|
421
|
+
var _render48 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
422
|
+
disabled: true,
|
|
423
|
+
isLoading: true
|
|
424
|
+
}))),
|
|
425
|
+
container = _render48.container;
|
|
426
|
+
|
|
427
|
+
expect(container).toMatchSnapshot();
|
|
428
|
+
});
|
|
429
|
+
it('should match snapshot with outline Button', function () {
|
|
430
|
+
var _render49 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
431
|
+
disabled: true
|
|
432
|
+
}))),
|
|
433
|
+
container = _render49.container;
|
|
434
|
+
|
|
435
|
+
expect(container).toMatchSnapshot();
|
|
436
|
+
});
|
|
437
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
438
|
+
var _render50 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
439
|
+
disabled: true,
|
|
440
|
+
isLoading: true
|
|
441
|
+
}))),
|
|
442
|
+
container = _render50.container;
|
|
443
|
+
|
|
444
|
+
expect(container).toMatchSnapshot();
|
|
445
|
+
});
|
|
446
|
+
it('should match snapshot with text Button', function () {
|
|
447
|
+
var _render51 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
448
|
+
disabled: true
|
|
449
|
+
}))),
|
|
450
|
+
container = _render51.container;
|
|
451
|
+
|
|
452
|
+
expect(container).toMatchSnapshot();
|
|
453
|
+
});
|
|
454
|
+
it('should match snapshot with link Button', function () {
|
|
455
|
+
var _render52 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
456
|
+
disabled: true
|
|
457
|
+
}))),
|
|
458
|
+
container = _render52.container;
|
|
459
|
+
|
|
460
|
+
expect(container).toMatchSnapshot();
|
|
461
|
+
});
|
|
462
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
463
|
+
var _render53 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
464
|
+
disabled: true,
|
|
465
|
+
icon: Booking
|
|
466
|
+
}))),
|
|
467
|
+
container = _render53.container;
|
|
468
|
+
|
|
469
|
+
expect(container).toMatchSnapshot();
|
|
470
|
+
});
|
|
471
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
472
|
+
var _render54 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
473
|
+
disabled: true,
|
|
474
|
+
icon: Booking,
|
|
475
|
+
isLoading: true
|
|
476
|
+
}))),
|
|
477
|
+
container = _render54.container;
|
|
478
|
+
|
|
479
|
+
expect(container).toMatchSnapshot();
|
|
480
|
+
});
|
|
481
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
482
|
+
var _render55 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
483
|
+
disabled: true,
|
|
484
|
+
icon: Booking
|
|
485
|
+
}))),
|
|
486
|
+
container = _render55.container;
|
|
487
|
+
|
|
488
|
+
expect(container).toMatchSnapshot();
|
|
489
|
+
});
|
|
490
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
491
|
+
var _render56 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
492
|
+
disabled: true,
|
|
493
|
+
icon: Booking,
|
|
494
|
+
isLoading: true
|
|
495
|
+
}))),
|
|
496
|
+
container = _render56.container;
|
|
497
|
+
|
|
498
|
+
expect(container).toMatchSnapshot();
|
|
499
|
+
});
|
|
500
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
501
|
+
var _render57 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
502
|
+
disabled: true,
|
|
503
|
+
icon: Booking
|
|
504
|
+
}))),
|
|
505
|
+
container = _render57.container;
|
|
506
|
+
|
|
507
|
+
expect(container).toMatchSnapshot();
|
|
508
|
+
});
|
|
509
|
+
it('should match snapshot with icon Button', function () {
|
|
510
|
+
var _render58 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
511
|
+
disabled: true,
|
|
512
|
+
icon: Booking
|
|
513
|
+
}))),
|
|
514
|
+
container = _render58.container;
|
|
515
|
+
|
|
516
|
+
expect(container).toMatchSnapshot();
|
|
517
|
+
});
|
|
518
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
519
|
+
var _render59 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
520
|
+
disabled: true,
|
|
521
|
+
icon: Booking,
|
|
522
|
+
isLoading: true
|
|
523
|
+
}))),
|
|
524
|
+
container = _render59.container;
|
|
525
|
+
|
|
526
|
+
expect(container).toMatchSnapshot();
|
|
527
|
+
});
|
|
242
528
|
});
|
|
243
529
|
});
|
|
244
|
-
describe('
|
|
245
|
-
it('
|
|
246
|
-
var
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
expect(container).toMatchSnapshot();
|
|
252
|
-
});
|
|
253
|
-
it('should match snapshot with outline Button', function () {
|
|
254
|
-
var _render30 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
255
|
-
disabled: true
|
|
256
|
-
}))),
|
|
257
|
-
container = _render30.container;
|
|
258
|
-
|
|
259
|
-
expect(container).toMatchSnapshot();
|
|
260
|
-
});
|
|
261
|
-
it('should match snapshot with text Button', function () {
|
|
262
|
-
var _render31 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
263
|
-
disabled: true
|
|
264
|
-
}))),
|
|
265
|
-
container = _render31.container;
|
|
530
|
+
describe('buttons rendering as an anchor', function () {
|
|
531
|
+
it('Default Button with href prop', function () {
|
|
532
|
+
var _render60 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
533
|
+
href: "http://www.gympass.com",
|
|
534
|
+
target: "blank"
|
|
535
|
+
}, "Default Button as an anchor"))),
|
|
536
|
+
container = _render60.container;
|
|
266
537
|
|
|
267
538
|
expect(container).toMatchSnapshot();
|
|
268
539
|
});
|
|
269
|
-
it('
|
|
270
|
-
var
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
540
|
+
it('Default Button with href prop and Loading', function () {
|
|
541
|
+
var _render61 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
542
|
+
href: "http://www.gympass.com",
|
|
543
|
+
target: "blank",
|
|
544
|
+
isLoading: true
|
|
545
|
+
}, "Default Button as an anchor"))),
|
|
546
|
+
container = _render61.container;
|
|
274
547
|
|
|
275
548
|
expect(container).toMatchSnapshot();
|
|
276
549
|
});
|
|
277
|
-
it('
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}))),
|
|
282
|
-
container =
|
|
550
|
+
it('Link Button with href prop', function () {
|
|
551
|
+
var _render62 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
552
|
+
href: "http://www.gympass.com",
|
|
553
|
+
target: "blank"
|
|
554
|
+
}, "Link as an anchor"))),
|
|
555
|
+
container = _render62.container;
|
|
283
556
|
|
|
284
557
|
expect(container).toMatchSnapshot();
|
|
285
558
|
});
|
|
286
|
-
it('
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}))),
|
|
291
|
-
container =
|
|
559
|
+
it('Outline Button with href prop', function () {
|
|
560
|
+
var _render63 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
561
|
+
href: "http://www.gympass.com",
|
|
562
|
+
target: "blank"
|
|
563
|
+
}, "Outline as an anchor"))),
|
|
564
|
+
container = _render63.container;
|
|
292
565
|
|
|
293
566
|
expect(container).toMatchSnapshot();
|
|
294
567
|
});
|
|
295
|
-
it('
|
|
296
|
-
var
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
568
|
+
it('Outline Button with href prop and Loading', function () {
|
|
569
|
+
var _render64 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
570
|
+
href: "http://www.gympass.com",
|
|
571
|
+
target: "blank",
|
|
572
|
+
isLoading: true
|
|
573
|
+
}, "Outline as an anchor"))),
|
|
574
|
+
container = _render64.container;
|
|
301
575
|
|
|
302
576
|
expect(container).toMatchSnapshot();
|
|
303
577
|
});
|
|
304
|
-
it('
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}))),
|
|
309
|
-
container =
|
|
578
|
+
it('Text Button with href prop', function () {
|
|
579
|
+
var _render65 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
580
|
+
href: "http://www.gympass.com",
|
|
581
|
+
target: "blank"
|
|
582
|
+
}, "Text as an anchor"))),
|
|
583
|
+
container = _render65.container;
|
|
310
584
|
|
|
311
585
|
expect(container).toMatchSnapshot();
|
|
312
586
|
});
|
|
313
587
|
});
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
588
|
+
describe('secondary buttons', function () {
|
|
589
|
+
describe('Without props', function () {
|
|
590
|
+
it('should match snapshot with default Button', function () {
|
|
591
|
+
var _render66 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
592
|
+
secondary: true
|
|
593
|
+
}))),
|
|
594
|
+
container = _render66.container;
|
|
595
|
+
|
|
596
|
+
expect(container).toMatchSnapshot();
|
|
597
|
+
});
|
|
598
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
599
|
+
var _render67 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
600
|
+
secondary: true,
|
|
601
|
+
isLoading: true
|
|
602
|
+
}))),
|
|
603
|
+
container = _render67.container;
|
|
604
|
+
|
|
605
|
+
expect(container).toMatchSnapshot();
|
|
606
|
+
});
|
|
607
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
608
|
+
var _render68 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
609
|
+
secondary: true,
|
|
610
|
+
icon: Booking
|
|
611
|
+
}))),
|
|
612
|
+
container = _render68.container;
|
|
613
|
+
|
|
614
|
+
expect(container).toMatchSnapshot();
|
|
615
|
+
});
|
|
616
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
617
|
+
var _render69 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
618
|
+
secondary: true,
|
|
619
|
+
icon: Booking,
|
|
620
|
+
isLoading: true
|
|
621
|
+
}))),
|
|
622
|
+
container = _render69.container;
|
|
623
|
+
|
|
624
|
+
expect(container).toMatchSnapshot();
|
|
625
|
+
});
|
|
626
|
+
it('should match snapshot with outline Button', function () {
|
|
627
|
+
var _render70 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
628
|
+
secondary: true
|
|
629
|
+
}))),
|
|
630
|
+
container = _render70.container;
|
|
631
|
+
|
|
632
|
+
expect(container).toMatchSnapshot();
|
|
633
|
+
});
|
|
634
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
635
|
+
var _render71 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
636
|
+
secondary: true,
|
|
637
|
+
isLoading: true
|
|
638
|
+
}))),
|
|
639
|
+
container = _render71.container;
|
|
640
|
+
|
|
641
|
+
expect(container).toMatchSnapshot();
|
|
642
|
+
});
|
|
643
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
644
|
+
var _render72 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
645
|
+
icon: Booking,
|
|
646
|
+
secondary: true
|
|
647
|
+
}))),
|
|
648
|
+
container = _render72.container;
|
|
649
|
+
|
|
650
|
+
expect(container).toMatchSnapshot();
|
|
651
|
+
});
|
|
652
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
653
|
+
var _render73 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
654
|
+
icon: Booking,
|
|
655
|
+
secondary: true,
|
|
656
|
+
isLoading: true
|
|
657
|
+
}))),
|
|
658
|
+
container = _render73.container;
|
|
659
|
+
|
|
660
|
+
expect(container).toMatchSnapshot();
|
|
661
|
+
});
|
|
662
|
+
it('should match snapshot with text Button', function () {
|
|
663
|
+
var _render74 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
664
|
+
secondary: true
|
|
665
|
+
}))),
|
|
666
|
+
container = _render74.container;
|
|
667
|
+
|
|
668
|
+
expect(container).toMatchSnapshot();
|
|
669
|
+
});
|
|
670
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
671
|
+
var _render75 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
672
|
+
secondary: true,
|
|
673
|
+
icon: Booking
|
|
674
|
+
}))),
|
|
675
|
+
container = _render75.container;
|
|
676
|
+
|
|
677
|
+
expect(container).toMatchSnapshot();
|
|
678
|
+
});
|
|
679
|
+
it('should match snapshot with link Button', function () {
|
|
680
|
+
var _render76 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
681
|
+
secondary: true
|
|
682
|
+
}))),
|
|
683
|
+
container = _render76.container;
|
|
684
|
+
|
|
685
|
+
expect(container).toMatchSnapshot();
|
|
686
|
+
});
|
|
687
|
+
it('should match snapshot with link Button with Icon', function () {
|
|
688
|
+
var _render77 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
689
|
+
icon: Booking
|
|
690
|
+
}))),
|
|
691
|
+
container = _render77.container;
|
|
692
|
+
|
|
693
|
+
expect(container).toMatchSnapshot();
|
|
694
|
+
});
|
|
695
|
+
it('should match snapshot with icon Button', function () {
|
|
696
|
+
var _render78 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
697
|
+
icon: Booking,
|
|
698
|
+
secondary: true
|
|
699
|
+
}))),
|
|
700
|
+
container = _render78.container;
|
|
701
|
+
|
|
702
|
+
expect(container).toMatchSnapshot();
|
|
703
|
+
});
|
|
704
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
705
|
+
var _render79 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
706
|
+
icon: Booking,
|
|
707
|
+
secondary: true,
|
|
708
|
+
isLoading: true
|
|
709
|
+
}))),
|
|
710
|
+
container = _render79.container;
|
|
711
|
+
|
|
712
|
+
expect(container).toMatchSnapshot();
|
|
713
|
+
});
|
|
714
|
+
});
|
|
715
|
+
describe('With inverted prop', function () {
|
|
716
|
+
it('should match snapshot with default Button', function () {
|
|
717
|
+
var _render80 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
718
|
+
inverted: true,
|
|
719
|
+
secondary: true
|
|
720
|
+
}))),
|
|
721
|
+
container = _render80.container;
|
|
722
|
+
|
|
723
|
+
expect(container).toMatchSnapshot();
|
|
724
|
+
});
|
|
725
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
726
|
+
var _render81 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
727
|
+
inverted: true,
|
|
728
|
+
secondary: true,
|
|
729
|
+
isLoading: true
|
|
730
|
+
}))),
|
|
731
|
+
container = _render81.container;
|
|
732
|
+
|
|
733
|
+
expect(container).toMatchSnapshot();
|
|
734
|
+
});
|
|
735
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
736
|
+
var _render82 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
737
|
+
inverted: true,
|
|
738
|
+
icon: Booking,
|
|
739
|
+
secondary: true
|
|
740
|
+
}))),
|
|
741
|
+
container = _render82.container;
|
|
742
|
+
|
|
743
|
+
expect(container).toMatchSnapshot();
|
|
744
|
+
});
|
|
745
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
746
|
+
var _render83 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
747
|
+
inverted: true,
|
|
748
|
+
icon: Booking,
|
|
749
|
+
secondary: true,
|
|
750
|
+
isLoading: true
|
|
751
|
+
}))),
|
|
752
|
+
container = _render83.container;
|
|
753
|
+
|
|
754
|
+
expect(container).toMatchSnapshot();
|
|
755
|
+
});
|
|
756
|
+
it('should match snapshot with outline Button', function () {
|
|
757
|
+
var _render84 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
758
|
+
inverted: true,
|
|
759
|
+
secondary: true
|
|
760
|
+
}))),
|
|
761
|
+
container = _render84.container;
|
|
762
|
+
|
|
763
|
+
expect(container).toMatchSnapshot();
|
|
764
|
+
});
|
|
765
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
766
|
+
var _render85 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
767
|
+
inverted: true,
|
|
768
|
+
secondary: true,
|
|
769
|
+
isLoading: true
|
|
770
|
+
}))),
|
|
771
|
+
container = _render85.container;
|
|
772
|
+
|
|
773
|
+
expect(container).toMatchSnapshot();
|
|
774
|
+
});
|
|
775
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
776
|
+
var _render86 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
777
|
+
inverted: true,
|
|
778
|
+
icon: Booking,
|
|
779
|
+
secondary: true
|
|
780
|
+
}))),
|
|
781
|
+
container = _render86.container;
|
|
782
|
+
|
|
783
|
+
expect(container).toMatchSnapshot();
|
|
784
|
+
});
|
|
785
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
786
|
+
var _render87 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
787
|
+
inverted: true,
|
|
788
|
+
icon: Booking,
|
|
789
|
+
secondary: true,
|
|
790
|
+
isLoading: true
|
|
791
|
+
}))),
|
|
792
|
+
container = _render87.container;
|
|
793
|
+
|
|
794
|
+
expect(container).toMatchSnapshot();
|
|
795
|
+
});
|
|
796
|
+
it('should match snapshot with text Button', function () {
|
|
797
|
+
var _render88 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
798
|
+
inverted: true,
|
|
799
|
+
secondary: true
|
|
800
|
+
}))),
|
|
801
|
+
container = _render88.container;
|
|
802
|
+
|
|
803
|
+
expect(container).toMatchSnapshot();
|
|
804
|
+
});
|
|
805
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
806
|
+
var _render89 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
807
|
+
inverted: true,
|
|
808
|
+
icon: Booking,
|
|
809
|
+
secondary: true
|
|
810
|
+
}))),
|
|
811
|
+
container = _render89.container;
|
|
812
|
+
|
|
813
|
+
expect(container).toMatchSnapshot();
|
|
814
|
+
});
|
|
815
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
816
|
+
var _render90 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
817
|
+
inverted: true,
|
|
818
|
+
icon: Booking,
|
|
819
|
+
secondary: true
|
|
820
|
+
}))),
|
|
821
|
+
container = _render90.container;
|
|
822
|
+
|
|
823
|
+
expect(container).toMatchSnapshot();
|
|
824
|
+
});
|
|
825
|
+
it('should match snapshot with icon Button', function () {
|
|
826
|
+
var _render91 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
827
|
+
inverted: true,
|
|
828
|
+
icon: Booking,
|
|
829
|
+
secondary: true
|
|
830
|
+
}))),
|
|
831
|
+
container = _render91.container;
|
|
832
|
+
|
|
833
|
+
expect(container).toMatchSnapshot();
|
|
834
|
+
});
|
|
835
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
836
|
+
var _render92 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
837
|
+
inverted: true,
|
|
838
|
+
icon: Booking,
|
|
839
|
+
secondary: true,
|
|
840
|
+
isLoading: true
|
|
841
|
+
}))),
|
|
842
|
+
container = _render92.container;
|
|
843
|
+
|
|
844
|
+
expect(container).toMatchSnapshot();
|
|
845
|
+
});
|
|
846
|
+
});
|
|
847
|
+
describe('With small prop', function () {
|
|
848
|
+
it('should match snapshot with default Button', function () {
|
|
849
|
+
var _render93 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
850
|
+
small: true,
|
|
851
|
+
secondary: true
|
|
852
|
+
}))),
|
|
853
|
+
container = _render93.container;
|
|
854
|
+
|
|
855
|
+
expect(container).toMatchSnapshot();
|
|
856
|
+
});
|
|
857
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
858
|
+
var _render94 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
859
|
+
small: true,
|
|
860
|
+
secondary: true,
|
|
861
|
+
isLoading: true
|
|
862
|
+
}))),
|
|
863
|
+
container = _render94.container;
|
|
864
|
+
|
|
865
|
+
expect(container).toMatchSnapshot();
|
|
866
|
+
});
|
|
867
|
+
it('should match snapshot with outline Button', function () {
|
|
868
|
+
var _render95 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
869
|
+
small: true,
|
|
870
|
+
secondary: true
|
|
871
|
+
}))),
|
|
872
|
+
container = _render95.container;
|
|
873
|
+
|
|
874
|
+
expect(container).toMatchSnapshot();
|
|
875
|
+
});
|
|
876
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
877
|
+
var _render96 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
878
|
+
small: true,
|
|
879
|
+
secondary: true,
|
|
880
|
+
isLoading: true
|
|
881
|
+
}))),
|
|
882
|
+
container = _render96.container;
|
|
883
|
+
|
|
884
|
+
expect(container).toMatchSnapshot();
|
|
885
|
+
});
|
|
886
|
+
it('should match snapshot with text Button', function () {
|
|
887
|
+
var _render97 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
888
|
+
small: true,
|
|
889
|
+
secondary: true
|
|
890
|
+
}))),
|
|
891
|
+
container = _render97.container;
|
|
892
|
+
|
|
893
|
+
expect(container).toMatchSnapshot();
|
|
894
|
+
});
|
|
895
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
896
|
+
var _render98 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
897
|
+
small: true,
|
|
898
|
+
icon: Booking,
|
|
899
|
+
secondary: true
|
|
900
|
+
}))),
|
|
901
|
+
container = _render98.container;
|
|
902
|
+
|
|
903
|
+
expect(container).toMatchSnapshot();
|
|
904
|
+
});
|
|
905
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
906
|
+
var _render99 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
907
|
+
small: true,
|
|
908
|
+
icon: Booking,
|
|
909
|
+
secondary: true,
|
|
910
|
+
isLoading: true
|
|
911
|
+
}))),
|
|
912
|
+
container = _render99.container;
|
|
913
|
+
|
|
914
|
+
expect(container).toMatchSnapshot();
|
|
915
|
+
});
|
|
916
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
917
|
+
var _render100 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
918
|
+
icon: Booking,
|
|
919
|
+
small: true,
|
|
920
|
+
secondary: true
|
|
921
|
+
}))),
|
|
922
|
+
container = _render100.container;
|
|
923
|
+
|
|
924
|
+
expect(container).toMatchSnapshot();
|
|
925
|
+
});
|
|
926
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
927
|
+
var _render101 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
928
|
+
icon: Booking,
|
|
929
|
+
small: true,
|
|
930
|
+
secondary: true,
|
|
931
|
+
isLoading: true
|
|
932
|
+
}))),
|
|
933
|
+
container = _render101.container;
|
|
934
|
+
|
|
935
|
+
expect(container).toMatchSnapshot();
|
|
936
|
+
});
|
|
937
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
938
|
+
var _render102 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
939
|
+
icon: Booking,
|
|
940
|
+
small: true,
|
|
941
|
+
secondary: true
|
|
942
|
+
}))),
|
|
943
|
+
container = _render102.container;
|
|
944
|
+
|
|
945
|
+
expect(container).toMatchSnapshot();
|
|
946
|
+
});
|
|
947
|
+
it('should match snapshot with icon Button', function () {
|
|
948
|
+
var _render103 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
949
|
+
icon: Booking,
|
|
950
|
+
small: true,
|
|
951
|
+
secondary: true
|
|
952
|
+
}))),
|
|
953
|
+
container = _render103.container;
|
|
954
|
+
|
|
955
|
+
expect(container).toMatchSnapshot();
|
|
956
|
+
});
|
|
957
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
958
|
+
var _render104 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
959
|
+
icon: Booking,
|
|
960
|
+
small: true,
|
|
961
|
+
secondary: true,
|
|
962
|
+
isLoading: true
|
|
963
|
+
}))),
|
|
964
|
+
container = _render104.container;
|
|
965
|
+
|
|
966
|
+
expect(container).toMatchSnapshot();
|
|
967
|
+
});
|
|
968
|
+
});
|
|
969
|
+
describe('With full prop', function () {
|
|
970
|
+
it('should match snapshot with default Button', function () {
|
|
971
|
+
var _render105 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
972
|
+
full: true,
|
|
973
|
+
secondary: true
|
|
974
|
+
}))),
|
|
975
|
+
container = _render105.container;
|
|
976
|
+
|
|
977
|
+
expect(container).toMatchSnapshot();
|
|
978
|
+
});
|
|
979
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
980
|
+
var _render106 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
981
|
+
full: true,
|
|
982
|
+
secondary: true,
|
|
983
|
+
isLoading: true
|
|
984
|
+
}))),
|
|
985
|
+
container = _render106.container;
|
|
986
|
+
|
|
987
|
+
expect(container).toMatchSnapshot();
|
|
988
|
+
});
|
|
989
|
+
it('should match snapshot with outline Button', function () {
|
|
990
|
+
var _render107 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
991
|
+
full: true,
|
|
992
|
+
secondary: true
|
|
993
|
+
}))),
|
|
994
|
+
container = _render107.container;
|
|
995
|
+
|
|
996
|
+
expect(container).toMatchSnapshot();
|
|
997
|
+
});
|
|
998
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
999
|
+
var _render108 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1000
|
+
full: true,
|
|
1001
|
+
secondary: true,
|
|
1002
|
+
isLoading: true
|
|
1003
|
+
}))),
|
|
1004
|
+
container = _render108.container;
|
|
1005
|
+
|
|
1006
|
+
expect(container).toMatchSnapshot();
|
|
1007
|
+
});
|
|
1008
|
+
it('should match snapshot with text Button', function () {
|
|
1009
|
+
var _render109 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
1010
|
+
full: true,
|
|
1011
|
+
secondary: true
|
|
1012
|
+
}))),
|
|
1013
|
+
container = _render109.container;
|
|
1014
|
+
|
|
1015
|
+
expect(container).toMatchSnapshot();
|
|
1016
|
+
});
|
|
1017
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
1018
|
+
var _render110 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1019
|
+
full: true,
|
|
1020
|
+
icon: Booking,
|
|
1021
|
+
secondary: true
|
|
1022
|
+
}))),
|
|
1023
|
+
container = _render110.container;
|
|
1024
|
+
|
|
1025
|
+
expect(container).toMatchSnapshot();
|
|
1026
|
+
});
|
|
1027
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
1028
|
+
var _render111 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1029
|
+
full: true,
|
|
1030
|
+
icon: Booking,
|
|
1031
|
+
secondary: true,
|
|
1032
|
+
isLoading: true
|
|
1033
|
+
}))),
|
|
1034
|
+
container = _render111.container;
|
|
1035
|
+
|
|
1036
|
+
expect(container).toMatchSnapshot();
|
|
1037
|
+
});
|
|
1038
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
1039
|
+
var _render112 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1040
|
+
full: true,
|
|
1041
|
+
icon: Booking,
|
|
1042
|
+
secondary: true
|
|
1043
|
+
}))),
|
|
1044
|
+
container = _render112.container;
|
|
1045
|
+
|
|
1046
|
+
expect(container).toMatchSnapshot();
|
|
1047
|
+
});
|
|
1048
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
1049
|
+
var _render113 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1050
|
+
full: true,
|
|
1051
|
+
icon: Booking,
|
|
1052
|
+
secondary: true,
|
|
1053
|
+
isLoading: true
|
|
1054
|
+
}))),
|
|
1055
|
+
container = _render113.container;
|
|
1056
|
+
|
|
1057
|
+
expect(container).toMatchSnapshot();
|
|
1058
|
+
});
|
|
1059
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
1060
|
+
var _render114 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
1061
|
+
full: true,
|
|
1062
|
+
icon: Booking,
|
|
1063
|
+
secondary: true
|
|
1064
|
+
}))),
|
|
1065
|
+
container = _render114.container;
|
|
1066
|
+
|
|
1067
|
+
expect(container).toMatchSnapshot();
|
|
1068
|
+
});
|
|
1069
|
+
});
|
|
342
1070
|
});
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
1071
|
+
describe('disabled buttons', function () {
|
|
1072
|
+
describe('With disabled prop', function () {
|
|
1073
|
+
it('should match snapshot with default Button', function () {
|
|
1074
|
+
var _render115 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1075
|
+
disabled: true
|
|
1076
|
+
}))),
|
|
1077
|
+
container = _render115.container;
|
|
1078
|
+
|
|
1079
|
+
expect(container).toMatchSnapshot();
|
|
1080
|
+
});
|
|
1081
|
+
it('should match snapshot with default Button and Loading', function () {
|
|
1082
|
+
var _render116 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1083
|
+
disabled: true,
|
|
1084
|
+
isLoading: true
|
|
1085
|
+
}))),
|
|
1086
|
+
container = _render116.container;
|
|
1087
|
+
|
|
1088
|
+
expect(container).toMatchSnapshot();
|
|
1089
|
+
});
|
|
1090
|
+
it('should match snapshot with outline Button', function () {
|
|
1091
|
+
var _render117 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1092
|
+
disabled: true
|
|
1093
|
+
}))),
|
|
1094
|
+
container = _render117.container;
|
|
1095
|
+
|
|
1096
|
+
expect(container).toMatchSnapshot();
|
|
1097
|
+
});
|
|
1098
|
+
it('should match snapshot with outline Button and Loading', function () {
|
|
1099
|
+
var _render118 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1100
|
+
disabled: true,
|
|
1101
|
+
isLoading: true
|
|
1102
|
+
}))),
|
|
1103
|
+
container = _render118.container;
|
|
1104
|
+
|
|
1105
|
+
expect(container).toMatchSnapshot();
|
|
1106
|
+
});
|
|
1107
|
+
it('should match snapshot with text Button', function () {
|
|
1108
|
+
var _render119 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
1109
|
+
disabled: true
|
|
1110
|
+
}))),
|
|
1111
|
+
container = _render119.container;
|
|
1112
|
+
|
|
1113
|
+
expect(container).toMatchSnapshot();
|
|
1114
|
+
});
|
|
1115
|
+
it('should match snapshot with link Button', function () {
|
|
1116
|
+
var _render120 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
1117
|
+
disabled: true
|
|
1118
|
+
}))),
|
|
1119
|
+
container = _render120.container;
|
|
1120
|
+
|
|
1121
|
+
expect(container).toMatchSnapshot();
|
|
1122
|
+
});
|
|
1123
|
+
it('should match snapshot with default Button with Icon', function () {
|
|
1124
|
+
var _render121 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1125
|
+
disabled: true,
|
|
1126
|
+
icon: Booking
|
|
1127
|
+
}))),
|
|
1128
|
+
container = _render121.container;
|
|
1129
|
+
|
|
1130
|
+
expect(container).toMatchSnapshot();
|
|
1131
|
+
});
|
|
1132
|
+
it('should match snapshot with default Button with Icon and Loading', function () {
|
|
1133
|
+
var _render122 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1134
|
+
disabled: true,
|
|
1135
|
+
icon: Booking,
|
|
1136
|
+
isLoading: true
|
|
1137
|
+
}))),
|
|
1138
|
+
container = _render122.container;
|
|
1139
|
+
|
|
1140
|
+
expect(container).toMatchSnapshot();
|
|
1141
|
+
});
|
|
1142
|
+
it('should match snapshot with outline Button with Icon', function () {
|
|
1143
|
+
var _render123 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1144
|
+
disabled: true,
|
|
1145
|
+
icon: Booking
|
|
1146
|
+
}))),
|
|
1147
|
+
container = _render123.container;
|
|
1148
|
+
|
|
1149
|
+
expect(container).toMatchSnapshot();
|
|
1150
|
+
});
|
|
1151
|
+
it('should match snapshot with outline Button with Icon and Loading', function () {
|
|
1152
|
+
var _render124 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1153
|
+
disabled: true,
|
|
1154
|
+
icon: Booking,
|
|
1155
|
+
isLoading: true
|
|
1156
|
+
}))),
|
|
1157
|
+
container = _render124.container;
|
|
1158
|
+
|
|
1159
|
+
expect(container).toMatchSnapshot();
|
|
1160
|
+
});
|
|
1161
|
+
it('should match snapshot with text Button with Icon', function () {
|
|
1162
|
+
var _render125 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
1163
|
+
disabled: true,
|
|
1164
|
+
icon: Booking
|
|
1165
|
+
}))),
|
|
1166
|
+
container = _render125.container;
|
|
1167
|
+
|
|
1168
|
+
expect(container).toMatchSnapshot();
|
|
1169
|
+
});
|
|
1170
|
+
it('should match snapshot with icon Button', function () {
|
|
1171
|
+
var _render126 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
1172
|
+
disabled: true,
|
|
1173
|
+
icon: Booking
|
|
1174
|
+
}))),
|
|
1175
|
+
container = _render126.container;
|
|
1176
|
+
|
|
1177
|
+
expect(container).toMatchSnapshot();
|
|
1178
|
+
});
|
|
1179
|
+
it('should match snapshot with icon Button and Loading', function () {
|
|
1180
|
+
var _render127 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
1181
|
+
disabled: true,
|
|
1182
|
+
icon: Booking,
|
|
1183
|
+
isLoading: true
|
|
1184
|
+
}))),
|
|
1185
|
+
container = _render127.container;
|
|
1186
|
+
|
|
1187
|
+
expect(container).toMatchSnapshot();
|
|
1188
|
+
});
|
|
1189
|
+
});
|
|
351
1190
|
});
|
|
352
1191
|
});
|
|
353
|
-
describe('
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
var _render41 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
357
|
-
secondary: true
|
|
358
|
-
}))),
|
|
359
|
-
container = _render41.container;
|
|
1192
|
+
describe('onClick prop', function () {
|
|
1193
|
+
it('should call onClick function when click on Button', function () {
|
|
1194
|
+
var onClickMock = jest.fn();
|
|
360
1195
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
secondary: true,
|
|
366
|
-
icon: Booking
|
|
367
|
-
}))),
|
|
368
|
-
container = _render42.container;
|
|
369
|
-
|
|
370
|
-
expect(container).toMatchSnapshot();
|
|
371
|
-
});
|
|
372
|
-
it('should match snapshot with outline Button', function () {
|
|
373
|
-
var _render43 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
374
|
-
secondary: true
|
|
375
|
-
}))),
|
|
376
|
-
container = _render43.container;
|
|
1196
|
+
var _render128 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1197
|
+
onClick: onClickMock
|
|
1198
|
+
}, "Button"))),
|
|
1199
|
+
getByText = _render128.getByText;
|
|
377
1200
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
it('should match snapshot with outline Button with Icon', function () {
|
|
381
|
-
var _render44 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
382
|
-
icon: Booking,
|
|
383
|
-
secondary: true
|
|
384
|
-
}))),
|
|
385
|
-
container = _render44.container;
|
|
386
|
-
|
|
387
|
-
expect(container).toMatchSnapshot();
|
|
388
|
-
});
|
|
389
|
-
it('should match snapshot with text Button', function () {
|
|
390
|
-
var _render45 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
391
|
-
secondary: true
|
|
392
|
-
}))),
|
|
393
|
-
container = _render45.container;
|
|
394
|
-
|
|
395
|
-
expect(container).toMatchSnapshot();
|
|
396
|
-
});
|
|
397
|
-
it('should match snapshot with text Button with Icon', function () {
|
|
398
|
-
var _render46 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
399
|
-
secondary: true,
|
|
400
|
-
icon: Booking
|
|
401
|
-
}))),
|
|
402
|
-
container = _render46.container;
|
|
403
|
-
|
|
404
|
-
expect(container).toMatchSnapshot();
|
|
405
|
-
});
|
|
406
|
-
it('should match snapshot with link Button', function () {
|
|
407
|
-
var _render47 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
408
|
-
secondary: true
|
|
409
|
-
}))),
|
|
410
|
-
container = _render47.container;
|
|
411
|
-
|
|
412
|
-
expect(container).toMatchSnapshot();
|
|
413
|
-
});
|
|
414
|
-
it('should match snapshot with link Button with Icon', function () {
|
|
415
|
-
var _render48 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
416
|
-
icon: Booking
|
|
417
|
-
}))),
|
|
418
|
-
container = _render48.container;
|
|
419
|
-
|
|
420
|
-
expect(container).toMatchSnapshot();
|
|
421
|
-
});
|
|
422
|
-
it('should match snapshot with icon Button', function () {
|
|
423
|
-
var _render49 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
424
|
-
icon: Booking,
|
|
425
|
-
secondary: true
|
|
426
|
-
}))),
|
|
427
|
-
container = _render49.container;
|
|
428
|
-
|
|
429
|
-
expect(container).toMatchSnapshot();
|
|
430
|
-
});
|
|
1201
|
+
fireEvent.click(getByText('Button'));
|
|
1202
|
+
expect(onClickMock).toHaveBeenCalled();
|
|
431
1203
|
});
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var _render50 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
435
|
-
inverted: true,
|
|
436
|
-
secondary: true
|
|
437
|
-
}))),
|
|
438
|
-
container = _render50.container;
|
|
1204
|
+
it('should call onClick function when click on Button.Outline', function () {
|
|
1205
|
+
var onClickMock = jest.fn();
|
|
439
1206
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
inverted: true,
|
|
445
|
-
icon: Booking,
|
|
446
|
-
secondary: true
|
|
447
|
-
}))),
|
|
448
|
-
container = _render51.container;
|
|
1207
|
+
var _render129 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1208
|
+
onClick: onClickMock
|
|
1209
|
+
}, "Button.Outline"))),
|
|
1210
|
+
getByText = _render129.getByText;
|
|
449
1211
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
secondary: true
|
|
456
|
-
}))),
|
|
457
|
-
container = _render52.container;
|
|
458
|
-
|
|
459
|
-
expect(container).toMatchSnapshot();
|
|
460
|
-
});
|
|
461
|
-
it('should match snapshot with outline Button with Icon', function () {
|
|
462
|
-
var _render53 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
463
|
-
inverted: true,
|
|
464
|
-
icon: Booking,
|
|
465
|
-
secondary: true
|
|
466
|
-
}))),
|
|
467
|
-
container = _render53.container;
|
|
1212
|
+
fireEvent.click(getByText('Button.Outline'));
|
|
1213
|
+
expect(onClickMock).toHaveBeenCalled();
|
|
1214
|
+
});
|
|
1215
|
+
it('should call onClick function when click on Button.Text', function () {
|
|
1216
|
+
var onClickMock = jest.fn();
|
|
468
1217
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
inverted: true,
|
|
474
|
-
secondary: true
|
|
475
|
-
}))),
|
|
476
|
-
container = _render54.container;
|
|
1218
|
+
var _render130 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
1219
|
+
onClick: onClickMock
|
|
1220
|
+
}, "Button.Text"))),
|
|
1221
|
+
getByText = _render130.getByText;
|
|
477
1222
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
icon: Booking,
|
|
484
|
-
secondary: true
|
|
485
|
-
}))),
|
|
486
|
-
container = _render55.container;
|
|
1223
|
+
fireEvent.click(getByText('Button.Text'));
|
|
1224
|
+
expect(onClickMock).toHaveBeenCalled();
|
|
1225
|
+
});
|
|
1226
|
+
it('should call onClick function when click on Button.Icon', function () {
|
|
1227
|
+
var onClickMock = jest.fn();
|
|
487
1228
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
icon: Booking,
|
|
494
|
-
secondary: true
|
|
495
|
-
}))),
|
|
496
|
-
container = _render56.container;
|
|
1229
|
+
var _render131 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
1230
|
+
icon: Close,
|
|
1231
|
+
onClick: onClickMock
|
|
1232
|
+
}))),
|
|
1233
|
+
getByRole = _render131.getByRole;
|
|
497
1234
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
it('should match snapshot with icon Button', function () {
|
|
501
|
-
var _render57 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
502
|
-
inverted: true,
|
|
503
|
-
icon: Booking,
|
|
504
|
-
secondary: true
|
|
505
|
-
}))),
|
|
506
|
-
container = _render57.container;
|
|
507
|
-
|
|
508
|
-
expect(container).toMatchSnapshot();
|
|
509
|
-
});
|
|
1235
|
+
fireEvent.click(getByRole('button'));
|
|
1236
|
+
expect(onClickMock).toHaveBeenCalled();
|
|
510
1237
|
});
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
var _render58 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
514
|
-
small: true,
|
|
515
|
-
secondary: true
|
|
516
|
-
}))),
|
|
517
|
-
container = _render58.container;
|
|
1238
|
+
it('should not call onClick function when click on Button disabled', function () {
|
|
1239
|
+
var onClickMock = jest.fn();
|
|
518
1240
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
secondary: true
|
|
525
|
-
}))),
|
|
526
|
-
container = _render59.container;
|
|
1241
|
+
var _render132 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1242
|
+
disabled: true,
|
|
1243
|
+
onClick: onClickMock
|
|
1244
|
+
}, "Button"))),
|
|
1245
|
+
getByText = _render132.getByText;
|
|
527
1246
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
secondary: true
|
|
534
|
-
}))),
|
|
535
|
-
container = _render60.container;
|
|
1247
|
+
fireEvent.click(getByText('Button'));
|
|
1248
|
+
expect(onClickMock).not.toHaveBeenCalled();
|
|
1249
|
+
});
|
|
1250
|
+
it('should not call onClick function when click on Button is loading', function () {
|
|
1251
|
+
var onClickMock = jest.fn();
|
|
536
1252
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
icon: Booking,
|
|
543
|
-
secondary: true
|
|
544
|
-
}))),
|
|
545
|
-
container = _render61.container;
|
|
1253
|
+
var _render133 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1254
|
+
isLoading: true,
|
|
1255
|
+
onClick: onClickMock
|
|
1256
|
+
}, "Button"))),
|
|
1257
|
+
getByText = _render133.getByText;
|
|
546
1258
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
1259
|
+
fireEvent.click(getByText('Button'));
|
|
1260
|
+
expect(onClickMock).not.toHaveBeenCalled();
|
|
1261
|
+
});
|
|
1262
|
+
});
|
|
1263
|
+
describe('Loading prop', function () {
|
|
1264
|
+
describe('Default Button', function () {
|
|
1265
|
+
it('Text should not to be visible', function () {
|
|
1266
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1267
|
+
isLoading: true
|
|
1268
|
+
}, "Button")));
|
|
1269
|
+
var text = screen.getByText('Button');
|
|
1270
|
+
expect(text).toHaveStyle('color: transparent');
|
|
1271
|
+
});
|
|
1272
|
+
it('Icon should not to be visible', function () {
|
|
1273
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
561
1274
|
icon: Booking,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
})))
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
1275
|
+
isLoading: true,
|
|
1276
|
+
"aria-label": "button"
|
|
1277
|
+
}, "Button")));
|
|
1278
|
+
var button = screen.getByRole('button', {
|
|
1279
|
+
name: 'button'
|
|
1280
|
+
});
|
|
1281
|
+
var svg = within(button).getByRole('img');
|
|
1282
|
+
expect(svg).toHaveStyle('fill: transparent');
|
|
1283
|
+
});
|
|
1284
|
+
it('Spinner should to be rendered', function () {
|
|
1285
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1286
|
+
isLoading: true
|
|
1287
|
+
}, "Button")));
|
|
1288
|
+
var spinner = screen.getByLabelText('loading-icon');
|
|
1289
|
+
expect(spinner).toBeVisible();
|
|
1290
|
+
});
|
|
1291
|
+
it('Button should to be disabled', function () {
|
|
1292
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
1293
|
+
isLoading: true,
|
|
1294
|
+
"aria-label": "button"
|
|
1295
|
+
}, "Button")));
|
|
1296
|
+
var button = screen.getByRole('button', {
|
|
1297
|
+
name: 'button'
|
|
1298
|
+
});
|
|
1299
|
+
expect(button).toBeDisabled();
|
|
568
1300
|
});
|
|
569
|
-
|
|
570
|
-
|
|
1301
|
+
});
|
|
1302
|
+
describe('Outline Button', function () {
|
|
1303
|
+
it('Text should not to be visible', function () {
|
|
1304
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1305
|
+
isLoading: true
|
|
1306
|
+
}, "Button")));
|
|
1307
|
+
var text = screen.getByText('Button');
|
|
1308
|
+
expect(text).toHaveStyle('color: transparent');
|
|
1309
|
+
});
|
|
1310
|
+
it('Icon should not to be visible', function () {
|
|
1311
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
571
1312
|
icon: Booking,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
})))
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
1313
|
+
isLoading: true,
|
|
1314
|
+
"aria-label": "button"
|
|
1315
|
+
}, "Button")));
|
|
1316
|
+
var button = screen.getByRole('button', {
|
|
1317
|
+
name: 'button'
|
|
1318
|
+
});
|
|
1319
|
+
var svg = within(button).getByRole('img');
|
|
1320
|
+
expect(svg).toHaveStyle('fill: transparent');
|
|
1321
|
+
});
|
|
1322
|
+
it('Spinner should to be rendered', function () {
|
|
1323
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1324
|
+
isLoading: true
|
|
1325
|
+
}, "Button")));
|
|
1326
|
+
var spinner = screen.getByLabelText('loading-icon');
|
|
1327
|
+
expect(spinner).toBeVisible();
|
|
1328
|
+
});
|
|
1329
|
+
it('Button should to be disabled', function () {
|
|
1330
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
1331
|
+
isLoading: true,
|
|
1332
|
+
"aria-label": "button"
|
|
1333
|
+
}, "Button")));
|
|
1334
|
+
var button = screen.getByRole('button', {
|
|
1335
|
+
name: 'button'
|
|
1336
|
+
});
|
|
1337
|
+
expect(button).toBeDisabled();
|
|
578
1338
|
});
|
|
579
1339
|
});
|
|
580
|
-
describe('
|
|
581
|
-
it('should
|
|
582
|
-
|
|
583
|
-
full: true,
|
|
584
|
-
secondary: true
|
|
585
|
-
}))),
|
|
586
|
-
container = _render65.container;
|
|
587
|
-
|
|
588
|
-
expect(container).toMatchSnapshot();
|
|
589
|
-
});
|
|
590
|
-
it('should match snapshot with outline Button', function () {
|
|
591
|
-
var _render66 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
592
|
-
full: true,
|
|
593
|
-
secondary: true
|
|
594
|
-
}))),
|
|
595
|
-
container = _render66.container;
|
|
596
|
-
|
|
597
|
-
expect(container).toMatchSnapshot();
|
|
598
|
-
});
|
|
599
|
-
it('should match snapshot with text Button', function () {
|
|
600
|
-
var _render67 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
601
|
-
full: true,
|
|
602
|
-
secondary: true
|
|
603
|
-
}))),
|
|
604
|
-
container = _render67.container;
|
|
605
|
-
|
|
606
|
-
expect(container).toMatchSnapshot();
|
|
607
|
-
});
|
|
608
|
-
it('should match snapshot with default Button with Icon', function () {
|
|
609
|
-
var _render68 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
610
|
-
full: true,
|
|
1340
|
+
describe('Icon Button', function () {
|
|
1341
|
+
it('Icon should not to be visible', function () {
|
|
1342
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
611
1343
|
icon: Booking,
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
1344
|
+
isLoading: true,
|
|
1345
|
+
"aria-label": "button"
|
|
1346
|
+
})));
|
|
1347
|
+
var button = screen.getByRole('button', {
|
|
1348
|
+
name: 'button'
|
|
1349
|
+
});
|
|
1350
|
+
var svg = within(button).queryByRole('img');
|
|
1351
|
+
expect(svg).toBeNull();
|
|
1352
|
+
});
|
|
1353
|
+
it('Spinner should to be rendered', function () {
|
|
1354
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
621
1355
|
icon: Booking,
|
|
622
|
-
|
|
623
|
-
})))
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
expect(container).toMatchSnapshot();
|
|
1356
|
+
isLoading: true
|
|
1357
|
+
})));
|
|
1358
|
+
var spinner = screen.getByLabelText('loading-icon');
|
|
1359
|
+
expect(spinner).toBeVisible();
|
|
627
1360
|
});
|
|
628
|
-
it('should
|
|
629
|
-
|
|
630
|
-
full: true,
|
|
1361
|
+
it('Button should to be disabled', function () {
|
|
1362
|
+
render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
631
1363
|
icon: Booking,
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
});
|
|
640
|
-
describe('disabled buttons', function () {
|
|
641
|
-
describe('With disabled prop', function () {
|
|
642
|
-
it('should match snapshot with default Button', function () {
|
|
643
|
-
var _render71 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
644
|
-
disabled: true
|
|
645
|
-
}))),
|
|
646
|
-
container = _render71.container;
|
|
647
|
-
|
|
648
|
-
expect(container).toMatchSnapshot();
|
|
649
|
-
});
|
|
650
|
-
it('should match snapshot with outline Button', function () {
|
|
651
|
-
var _render72 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
652
|
-
disabled: true
|
|
653
|
-
}))),
|
|
654
|
-
container = _render72.container;
|
|
655
|
-
|
|
656
|
-
expect(container).toMatchSnapshot();
|
|
657
|
-
});
|
|
658
|
-
it('should match snapshot with text Button', function () {
|
|
659
|
-
var _render73 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
660
|
-
disabled: true
|
|
661
|
-
}))),
|
|
662
|
-
container = _render73.container;
|
|
663
|
-
|
|
664
|
-
expect(container).toMatchSnapshot();
|
|
665
|
-
});
|
|
666
|
-
it('should match snapshot with link Button', function () {
|
|
667
|
-
var _render74 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Link, {
|
|
668
|
-
disabled: true
|
|
669
|
-
}))),
|
|
670
|
-
container = _render74.container;
|
|
671
|
-
|
|
672
|
-
expect(container).toMatchSnapshot();
|
|
673
|
-
});
|
|
674
|
-
it('should match snapshot with default Button with Icon', function () {
|
|
675
|
-
var _render75 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
676
|
-
disabled: true,
|
|
677
|
-
icon: Booking
|
|
678
|
-
}))),
|
|
679
|
-
container = _render75.container;
|
|
680
|
-
|
|
681
|
-
expect(container).toMatchSnapshot();
|
|
682
|
-
});
|
|
683
|
-
it('should match snapshot with outline Button with Icon', function () {
|
|
684
|
-
var _render76 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
685
|
-
disabled: true,
|
|
686
|
-
icon: Booking
|
|
687
|
-
}))),
|
|
688
|
-
container = _render76.container;
|
|
689
|
-
|
|
690
|
-
expect(container).toMatchSnapshot();
|
|
691
|
-
});
|
|
692
|
-
it('should match snapshot with text Button with Icon', function () {
|
|
693
|
-
var _render77 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
694
|
-
disabled: true,
|
|
695
|
-
icon: Booking
|
|
696
|
-
}))),
|
|
697
|
-
container = _render77.container;
|
|
698
|
-
|
|
699
|
-
expect(container).toMatchSnapshot();
|
|
700
|
-
});
|
|
701
|
-
it('should match snapshot with icon Button', function () {
|
|
702
|
-
var _render78 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
703
|
-
disabled: true,
|
|
704
|
-
icon: Booking
|
|
705
|
-
}))),
|
|
706
|
-
container = _render78.container;
|
|
707
|
-
|
|
708
|
-
expect(container).toMatchSnapshot();
|
|
1364
|
+
isLoading: true,
|
|
1365
|
+
"aria-label": "button"
|
|
1366
|
+
})));
|
|
1367
|
+
var button = screen.getByRole('button', {
|
|
1368
|
+
name: 'button'
|
|
1369
|
+
});
|
|
1370
|
+
expect(button).toBeDisabled();
|
|
709
1371
|
});
|
|
710
1372
|
});
|
|
711
1373
|
});
|
|
712
1374
|
});
|
|
713
|
-
describe('onClick prop', function () {
|
|
714
|
-
it('should call onClick function when click on Button', function () {
|
|
715
|
-
var onClickMock = jest.fn();
|
|
716
|
-
|
|
717
|
-
var _render79 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
718
|
-
onClick: onClickMock
|
|
719
|
-
}, "Button"))),
|
|
720
|
-
getByText = _render79.getByText;
|
|
721
|
-
|
|
722
|
-
fireEvent.click(getByText('Button'));
|
|
723
|
-
expect(onClickMock).toHaveBeenCalled();
|
|
724
|
-
});
|
|
725
|
-
it('should call onClick function when click on Button.Outline', function () {
|
|
726
|
-
var onClickMock = jest.fn();
|
|
727
|
-
|
|
728
|
-
var _render80 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Outline, {
|
|
729
|
-
onClick: onClickMock
|
|
730
|
-
}, "Button.Outline"))),
|
|
731
|
-
getByText = _render80.getByText;
|
|
732
|
-
|
|
733
|
-
fireEvent.click(getByText('Button.Outline'));
|
|
734
|
-
expect(onClickMock).toHaveBeenCalled();
|
|
735
|
-
});
|
|
736
|
-
it('should call onClick function when click on Button.Text', function () {
|
|
737
|
-
var onClickMock = jest.fn();
|
|
738
|
-
|
|
739
|
-
var _render81 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Text, {
|
|
740
|
-
onClick: onClickMock
|
|
741
|
-
}, "Button.Text"))),
|
|
742
|
-
getByText = _render81.getByText;
|
|
743
|
-
|
|
744
|
-
fireEvent.click(getByText('Button.Text'));
|
|
745
|
-
expect(onClickMock).toHaveBeenCalled();
|
|
746
|
-
});
|
|
747
|
-
it('should call onClick function when click on Button.Icon', function () {
|
|
748
|
-
var onClickMock = jest.fn();
|
|
749
|
-
|
|
750
|
-
var _render82 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button.Icon, {
|
|
751
|
-
icon: Close,
|
|
752
|
-
onClick: onClickMock
|
|
753
|
-
}))),
|
|
754
|
-
getByRole = _render82.getByRole;
|
|
755
|
-
|
|
756
|
-
fireEvent.click(getByRole('button'));
|
|
757
|
-
expect(onClickMock).toHaveBeenCalled();
|
|
758
|
-
});
|
|
759
|
-
it('should not call onClick function when click on Button disabled', function () {
|
|
760
|
-
var onClickMock = jest.fn();
|
|
761
|
-
|
|
762
|
-
var _render83 = render( /*#__PURE__*/React.createElement(ThemeProvider, null, /*#__PURE__*/React.createElement(Button, {
|
|
763
|
-
disabled: true,
|
|
764
|
-
onClick: onClickMock
|
|
765
|
-
}, "Button"))),
|
|
766
|
-
getByText = _render83.getByText;
|
|
767
|
-
|
|
768
|
-
fireEvent.click(getByText('Button'));
|
|
769
|
-
expect(onClickMock).not.toHaveBeenCalled();
|
|
770
|
-
});
|
|
771
|
-
});
|
|
772
1375
|
});
|