@reltio/components 1.4.2299 → 1.4.2300
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.
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
|
-
import { render, screen } from '@testing-library/react';
|
|
49
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
50
50
|
import userEvent from '@testing-library/user-event';
|
|
51
51
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
52
52
|
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
@@ -131,35 +131,55 @@ describe('DateEditor behaviour', function () {
|
|
|
131
131
|
return [4 /*yield*/, user.type(textbox, '01/01/1800')];
|
|
132
132
|
case 1:
|
|
133
133
|
_a.sent();
|
|
134
|
-
|
|
134
|
+
return [4 /*yield*/, waitFor(function () {
|
|
135
|
+
return expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
136
|
+
})];
|
|
137
|
+
case 2:
|
|
138
|
+
_a.sent();
|
|
135
139
|
expect(props.onChange).toHaveBeenCalledWith(new Date('1800-01-01T00:00:00'));
|
|
136
140
|
props.onChange.mockClear();
|
|
137
141
|
return [4 /*yield*/, user.type(textbox, '12/31/1799')];
|
|
138
|
-
case
|
|
142
|
+
case 3:
|
|
143
|
+
_a.sent();
|
|
144
|
+
return [4 /*yield*/, screen.findByText('Date should not be before minimal date')];
|
|
145
|
+
case 4:
|
|
139
146
|
_a.sent();
|
|
140
|
-
screen.getByText('Date should not be before minimal date');
|
|
141
147
|
props.onChange.mockClear();
|
|
142
148
|
return [4 /*yield*/, user.type(textbox, '12/31/1798')];
|
|
143
|
-
case
|
|
149
|
+
case 5:
|
|
150
|
+
_a.sent();
|
|
151
|
+
return [4 /*yield*/, screen.findByText('Date should not be before minimal date')];
|
|
152
|
+
case 6:
|
|
144
153
|
_a.sent();
|
|
145
|
-
screen.getByText('Date should not be before minimal date');
|
|
146
154
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
147
155
|
return [4 /*yield*/, user.type(textbox, '12/31/2200')];
|
|
148
|
-
case
|
|
156
|
+
case 7:
|
|
157
|
+
_a.sent();
|
|
158
|
+
return [4 /*yield*/, waitFor(function () {
|
|
159
|
+
return expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
160
|
+
})];
|
|
161
|
+
case 8:
|
|
162
|
+
_a.sent();
|
|
163
|
+
return [4 /*yield*/, waitFor(function () {
|
|
164
|
+
return expect(screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
165
|
+
})];
|
|
166
|
+
case 9:
|
|
149
167
|
_a.sent();
|
|
150
|
-
expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
151
|
-
expect(screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
152
168
|
expect(props.onChange).toHaveBeenCalledWith(new Date('2200-12-31T00:00:00'));
|
|
153
169
|
props.onChange.mockClear();
|
|
154
170
|
return [4 /*yield*/, user.type(textbox, '01/01/2201')];
|
|
155
|
-
case
|
|
171
|
+
case 10:
|
|
172
|
+
_a.sent();
|
|
173
|
+
return [4 /*yield*/, screen.findByText('Date should not be after maximal date')];
|
|
174
|
+
case 11:
|
|
156
175
|
_a.sent();
|
|
157
|
-
screen.getByText('Date should not be after maximal date');
|
|
158
176
|
props.onChange.mockClear();
|
|
159
177
|
return [4 /*yield*/, user.type(textbox, '01/01/2202')];
|
|
160
|
-
case
|
|
178
|
+
case 12:
|
|
179
|
+
_a.sent();
|
|
180
|
+
return [4 /*yield*/, screen.findByText('Date should not be after maximal date')];
|
|
181
|
+
case 13:
|
|
161
182
|
_a.sent();
|
|
162
|
-
screen.getByText('Date should not be after maximal date');
|
|
163
183
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
164
184
|
return [2 /*return*/];
|
|
165
185
|
}
|
|
@@ -231,33 +251,53 @@ describe('DateEditor behaviour', function () {
|
|
|
231
251
|
return [4 /*yield*/, user.type(textbox, '01/01/1980')];
|
|
232
252
|
case 3:
|
|
233
253
|
_a.sent();
|
|
234
|
-
|
|
235
|
-
|
|
254
|
+
return [4 /*yield*/, waitFor(function () {
|
|
255
|
+
return expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
256
|
+
})];
|
|
236
257
|
case 4:
|
|
237
258
|
_a.sent();
|
|
238
|
-
|
|
259
|
+
return [4 /*yield*/, user.type(textbox, '12/31/1979')];
|
|
260
|
+
case 5:
|
|
261
|
+
_a.sent();
|
|
262
|
+
return [4 /*yield*/, screen.findByText('Date should not be before minimal date')];
|
|
263
|
+
case 6:
|
|
264
|
+
_a.sent();
|
|
239
265
|
props.onChange.mockClear();
|
|
240
266
|
return [4 /*yield*/, user.type(textbox, '12/31/1978')];
|
|
241
|
-
case
|
|
267
|
+
case 7:
|
|
268
|
+
_a.sent();
|
|
269
|
+
return [4 /*yield*/, screen.findByText('Date should not be before minimal date')];
|
|
270
|
+
case 8:
|
|
242
271
|
_a.sent();
|
|
243
|
-
screen.getByText('Date should not be before minimal date');
|
|
244
272
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
245
273
|
return [4 /*yield*/, user.type(textbox, '12/31/2029')];
|
|
246
|
-
case
|
|
274
|
+
case 9:
|
|
275
|
+
_a.sent();
|
|
276
|
+
return [4 /*yield*/, waitFor(function () {
|
|
277
|
+
return expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
278
|
+
})];
|
|
279
|
+
case 10:
|
|
280
|
+
_a.sent();
|
|
281
|
+
return [4 /*yield*/, waitFor(function () {
|
|
282
|
+
return expect(screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
283
|
+
})];
|
|
284
|
+
case 11:
|
|
247
285
|
_a.sent();
|
|
248
|
-
expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
249
|
-
expect(screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
250
286
|
expect(props.onChange).toHaveBeenCalledWith(new Date('2029-12-31T00:00:00'));
|
|
251
287
|
props.onChange.mockClear();
|
|
252
288
|
return [4 /*yield*/, user.type(textbox, '01/01/2030')];
|
|
253
|
-
case
|
|
289
|
+
case 12:
|
|
290
|
+
_a.sent();
|
|
291
|
+
return [4 /*yield*/, screen.findByText('Date should not be after maximal date')];
|
|
292
|
+
case 13:
|
|
254
293
|
_a.sent();
|
|
255
|
-
screen.getByText('Date should not be after maximal date');
|
|
256
294
|
props.onChange.mockClear();
|
|
257
295
|
return [4 /*yield*/, user.type(textbox, '01/01/2031')];
|
|
258
|
-
case
|
|
296
|
+
case 14:
|
|
297
|
+
_a.sent();
|
|
298
|
+
return [4 /*yield*/, screen.findByText('Date should not be after maximal date')];
|
|
299
|
+
case 15:
|
|
259
300
|
_a.sent();
|
|
260
|
-
screen.getByText('Date should not be after maximal date');
|
|
261
301
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
262
302
|
return [2 /*return*/];
|
|
263
303
|
}
|
|
@@ -319,16 +359,30 @@ describe('DateEditor behaviour', function () {
|
|
|
319
359
|
return [4 /*yield*/, user.type(textbox, '01/01/1900')];
|
|
320
360
|
case 1:
|
|
321
361
|
_a.sent();
|
|
322
|
-
|
|
323
|
-
|
|
362
|
+
return [4 /*yield*/, waitFor(function () {
|
|
363
|
+
return expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
364
|
+
})];
|
|
324
365
|
case 2:
|
|
325
366
|
_a.sent();
|
|
326
|
-
|
|
327
|
-
return [4 /*yield*/, user.type(textbox, '12/31/9999')];
|
|
367
|
+
return [4 /*yield*/, user.type(textbox, '12/31/1899')];
|
|
328
368
|
case 3:
|
|
329
369
|
_a.sent();
|
|
330
|
-
|
|
331
|
-
|
|
370
|
+
return [4 /*yield*/, screen.findByText('Date should not be before minimal date')];
|
|
371
|
+
case 4:
|
|
372
|
+
_a.sent();
|
|
373
|
+
return [4 /*yield*/, user.type(textbox, '12/31/9999')];
|
|
374
|
+
case 5:
|
|
375
|
+
_a.sent();
|
|
376
|
+
return [4 /*yield*/, waitFor(function () {
|
|
377
|
+
return expect(screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
378
|
+
})];
|
|
379
|
+
case 6:
|
|
380
|
+
_a.sent();
|
|
381
|
+
return [4 /*yield*/, waitFor(function () {
|
|
382
|
+
return expect(screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
383
|
+
})];
|
|
384
|
+
case 7:
|
|
385
|
+
_a.sent();
|
|
332
386
|
return [2 /*return*/];
|
|
333
387
|
}
|
|
334
388
|
});
|
|
@@ -136,35 +136,55 @@ describe('DateEditor behaviour', function () {
|
|
|
136
136
|
return [4 /*yield*/, user.type(textbox, '01/01/1800')];
|
|
137
137
|
case 1:
|
|
138
138
|
_a.sent();
|
|
139
|
-
|
|
139
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
140
|
+
return expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
141
|
+
})];
|
|
142
|
+
case 2:
|
|
143
|
+
_a.sent();
|
|
140
144
|
expect(props.onChange).toHaveBeenCalledWith(new Date('1800-01-01T00:00:00'));
|
|
141
145
|
props.onChange.mockClear();
|
|
142
146
|
return [4 /*yield*/, user.type(textbox, '12/31/1799')];
|
|
143
|
-
case
|
|
147
|
+
case 3:
|
|
148
|
+
_a.sent();
|
|
149
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be before minimal date')];
|
|
150
|
+
case 4:
|
|
144
151
|
_a.sent();
|
|
145
|
-
react_2.screen.getByText('Date should not be before minimal date');
|
|
146
152
|
props.onChange.mockClear();
|
|
147
153
|
return [4 /*yield*/, user.type(textbox, '12/31/1798')];
|
|
148
|
-
case
|
|
154
|
+
case 5:
|
|
155
|
+
_a.sent();
|
|
156
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be before minimal date')];
|
|
157
|
+
case 6:
|
|
149
158
|
_a.sent();
|
|
150
|
-
react_2.screen.getByText('Date should not be before minimal date');
|
|
151
159
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
152
160
|
return [4 /*yield*/, user.type(textbox, '12/31/2200')];
|
|
153
|
-
case
|
|
161
|
+
case 7:
|
|
162
|
+
_a.sent();
|
|
163
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
164
|
+
return expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
165
|
+
})];
|
|
166
|
+
case 8:
|
|
167
|
+
_a.sent();
|
|
168
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
169
|
+
return expect(react_2.screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
170
|
+
})];
|
|
171
|
+
case 9:
|
|
154
172
|
_a.sent();
|
|
155
|
-
expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
156
|
-
expect(react_2.screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
157
173
|
expect(props.onChange).toHaveBeenCalledWith(new Date('2200-12-31T00:00:00'));
|
|
158
174
|
props.onChange.mockClear();
|
|
159
175
|
return [4 /*yield*/, user.type(textbox, '01/01/2201')];
|
|
160
|
-
case
|
|
176
|
+
case 10:
|
|
177
|
+
_a.sent();
|
|
178
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be after maximal date')];
|
|
179
|
+
case 11:
|
|
161
180
|
_a.sent();
|
|
162
|
-
react_2.screen.getByText('Date should not be after maximal date');
|
|
163
181
|
props.onChange.mockClear();
|
|
164
182
|
return [4 /*yield*/, user.type(textbox, '01/01/2202')];
|
|
165
|
-
case
|
|
183
|
+
case 12:
|
|
184
|
+
_a.sent();
|
|
185
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be after maximal date')];
|
|
186
|
+
case 13:
|
|
166
187
|
_a.sent();
|
|
167
|
-
react_2.screen.getByText('Date should not be after maximal date');
|
|
168
188
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
169
189
|
return [2 /*return*/];
|
|
170
190
|
}
|
|
@@ -236,33 +256,53 @@ describe('DateEditor behaviour', function () {
|
|
|
236
256
|
return [4 /*yield*/, user.type(textbox, '01/01/1980')];
|
|
237
257
|
case 3:
|
|
238
258
|
_a.sent();
|
|
239
|
-
|
|
240
|
-
|
|
259
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
260
|
+
return expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
261
|
+
})];
|
|
241
262
|
case 4:
|
|
242
263
|
_a.sent();
|
|
243
|
-
|
|
264
|
+
return [4 /*yield*/, user.type(textbox, '12/31/1979')];
|
|
265
|
+
case 5:
|
|
266
|
+
_a.sent();
|
|
267
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be before minimal date')];
|
|
268
|
+
case 6:
|
|
269
|
+
_a.sent();
|
|
244
270
|
props.onChange.mockClear();
|
|
245
271
|
return [4 /*yield*/, user.type(textbox, '12/31/1978')];
|
|
246
|
-
case
|
|
272
|
+
case 7:
|
|
273
|
+
_a.sent();
|
|
274
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be before minimal date')];
|
|
275
|
+
case 8:
|
|
247
276
|
_a.sent();
|
|
248
|
-
react_2.screen.getByText('Date should not be before minimal date');
|
|
249
277
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
250
278
|
return [4 /*yield*/, user.type(textbox, '12/31/2029')];
|
|
251
|
-
case
|
|
279
|
+
case 9:
|
|
280
|
+
_a.sent();
|
|
281
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
282
|
+
return expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
283
|
+
})];
|
|
284
|
+
case 10:
|
|
285
|
+
_a.sent();
|
|
286
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
287
|
+
return expect(react_2.screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
288
|
+
})];
|
|
289
|
+
case 11:
|
|
252
290
|
_a.sent();
|
|
253
|
-
expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
254
|
-
expect(react_2.screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
255
291
|
expect(props.onChange).toHaveBeenCalledWith(new Date('2029-12-31T00:00:00'));
|
|
256
292
|
props.onChange.mockClear();
|
|
257
293
|
return [4 /*yield*/, user.type(textbox, '01/01/2030')];
|
|
258
|
-
case
|
|
294
|
+
case 12:
|
|
295
|
+
_a.sent();
|
|
296
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be after maximal date')];
|
|
297
|
+
case 13:
|
|
259
298
|
_a.sent();
|
|
260
|
-
react_2.screen.getByText('Date should not be after maximal date');
|
|
261
299
|
props.onChange.mockClear();
|
|
262
300
|
return [4 /*yield*/, user.type(textbox, '01/01/2031')];
|
|
263
|
-
case
|
|
301
|
+
case 14:
|
|
302
|
+
_a.sent();
|
|
303
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be after maximal date')];
|
|
304
|
+
case 15:
|
|
264
305
|
_a.sent();
|
|
265
|
-
react_2.screen.getByText('Date should not be after maximal date');
|
|
266
306
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
267
307
|
return [2 /*return*/];
|
|
268
308
|
}
|
|
@@ -324,16 +364,30 @@ describe('DateEditor behaviour', function () {
|
|
|
324
364
|
return [4 /*yield*/, user.type(textbox, '01/01/1900')];
|
|
325
365
|
case 1:
|
|
326
366
|
_a.sent();
|
|
327
|
-
|
|
328
|
-
|
|
367
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
368
|
+
return expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
369
|
+
})];
|
|
329
370
|
case 2:
|
|
330
371
|
_a.sent();
|
|
331
|
-
|
|
332
|
-
return [4 /*yield*/, user.type(textbox, '12/31/9999')];
|
|
372
|
+
return [4 /*yield*/, user.type(textbox, '12/31/1899')];
|
|
333
373
|
case 3:
|
|
334
374
|
_a.sent();
|
|
335
|
-
|
|
336
|
-
|
|
375
|
+
return [4 /*yield*/, react_2.screen.findByText('Date should not be before minimal date')];
|
|
376
|
+
case 4:
|
|
377
|
+
_a.sent();
|
|
378
|
+
return [4 /*yield*/, user.type(textbox, '12/31/9999')];
|
|
379
|
+
case 5:
|
|
380
|
+
_a.sent();
|
|
381
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
382
|
+
return expect(react_2.screen.queryByText('Date should not be before minimal date')).not.toBeInTheDocument();
|
|
383
|
+
})];
|
|
384
|
+
case 6:
|
|
385
|
+
_a.sent();
|
|
386
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
387
|
+
return expect(react_2.screen.queryByText('Date should not be after maximal date')).not.toBeInTheDocument();
|
|
388
|
+
})];
|
|
389
|
+
case 7:
|
|
390
|
+
_a.sent();
|
|
337
391
|
return [2 /*return*/];
|
|
338
392
|
}
|
|
339
393
|
});
|