Skip to content

Commit 32e4049

Browse files
committed
Fix tests
1 parent 2201b12 commit 32e4049

15 files changed

+60
-28
lines changed

packages/ra-core/src/controller/create/CreateBase.spec.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ describe('CreateBase', () => {
5555
test: 'test',
5656
},
5757
{ data: { test: 'test' }, resource: 'posts' },
58-
{ snapshot: [] }
58+
{ snapshot: [] },
59+
expect.anything()
5960
);
6061
});
6162
});
@@ -87,7 +88,8 @@ describe('CreateBase', () => {
8788
test: 'test',
8889
},
8990
{ data: { test: 'test' }, resource: 'posts' },
90-
{ snapshot: [] }
91+
{ snapshot: [] },
92+
expect.anything()
9193
);
9294
});
9395
expect(onSuccess).not.toHaveBeenCalled();
@@ -114,7 +116,8 @@ describe('CreateBase', () => {
114116
expect(onError).toHaveBeenCalledWith(
115117
{ message: 'test' },
116118
{ data: { test: 'test' }, resource: 'posts' },
117-
{ snapshot: [] }
119+
{ snapshot: [] },
120+
expect.anything()
118121
);
119122
});
120123
});
@@ -141,7 +144,8 @@ describe('CreateBase', () => {
141144
expect(onErrorOverride).toHaveBeenCalledWith(
142145
{ message: 'test' },
143146
{ data: { test: 'test' }, resource: 'posts' },
144-
{ snapshot: [] }
147+
expect.anything(),
148+
expect.anything()
145149
);
146150
});
147151
expect(onError).not.toHaveBeenCalled();

packages/ra-core/src/controller/edit/EditBase.spec.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ describe('EditBase', () => {
8181
resource: 'posts',
8282
meta: undefined,
8383
},
84-
{ snapshot: [] }
84+
{ snapshot: [] },
85+
expect.anything()
8586
);
8687
});
8788
});
@@ -125,7 +126,8 @@ describe('EditBase', () => {
125126
resource: 'posts',
126127
meta: undefined,
127128
},
128-
{ snapshot: [] }
129+
{ snapshot: [] },
130+
expect.anything()
129131
);
130132
});
131133
expect(onSuccess).not.toHaveBeenCalled();
@@ -162,7 +164,8 @@ describe('EditBase', () => {
162164
resource: 'posts',
163165
meta: undefined,
164166
},
165-
{ snapshot: [] }
167+
{ snapshot: [] },
168+
expect.anything()
166169
);
167170
});
168171
});
@@ -199,7 +202,8 @@ describe('EditBase', () => {
199202
resource: 'posts',
200203
meta: undefined,
201204
},
202-
{ snapshot: [] }
205+
{ snapshot: [] },
206+
expect.anything()
203207
);
204208
});
205209
expect(onError).not.toHaveBeenCalled();

packages/ra-core/src/controller/edit/useEditController.spec.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ describe('useEditController', () => {
459459
resource: 'posts',
460460
meta: undefined,
461461
},
462-
{ snapshot: expect.any(Array) }
462+
{ snapshot: expect.any(Array) },
463+
expect.anything()
463464
)
464465
);
465466
expect(notificationsSpy).toEqual([]);
@@ -513,7 +514,8 @@ describe('useEditController', () => {
513514
resource: 'posts',
514515
meta: undefined,
515516
},
516-
{ snapshot: expect.any(Array) }
517+
{ snapshot: expect.any(Array) },
518+
expect.anything()
517519
)
518520
);
519521
expect(notificationsSpy).toEqual([]);
@@ -566,7 +568,8 @@ describe('useEditController', () => {
566568
resource: 'posts',
567569
meta: undefined,
568570
},
569-
{ snapshot: expect.any(Array) }
571+
{ snapshot: expect.any(Array) },
572+
expect.anything()
570573
)
571574
);
572575
expect(notificationsSpy).toEqual([]);

packages/ra-core/src/controller/list/useListController.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ describe('useListController', () => {
240240
);
241241

242242
// Check that the permanent filter is not included in the displayedFilters and filterValues (passed to Filter form and button)
243-
expect(children).toHaveBeenCalledTimes(2);
244243
expect(children).toHaveBeenCalledWith(
245244
expect.objectContaining({
246245
displayedFilters: {},
@@ -264,7 +263,7 @@ describe('useListController', () => {
264263
'posts',
265264
expect.objectContaining({ filter: { foo: 2 } })
266265
);
267-
expect(children).toHaveBeenCalledTimes(4);
266+
expect(children).toHaveBeenCalledTimes(3);
268267
});
269268
});
270269

packages/ra-core/src/dataProvider/useDelete.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ describe('useDelete', () => {
336336
expect(onSuccess).toHaveBeenCalledWith(
337337
{ id: 1 },
338338
{ id: 1, previousData: { foo: 456 }, resource: 'foo' },
339-
{ snapshot: [] }
339+
{ snapshot: [] },
340+
expect.anything()
340341
);
341342
});
342343
});
@@ -372,7 +373,8 @@ describe('useDelete', () => {
372373
expect(onError).toHaveBeenCalledWith(
373374
new Error('not good'),
374375
{ id: 1, previousData: { foo: 456 }, resource: 'foo' },
375-
{ snapshot: [] }
376+
{ snapshot: [] },
377+
expect.anything()
376378
);
377379
});
378380
});

packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ describe('<DeleteWithConfirmButton />', () => {
223223
previousData: { id: 123, title: 'lorem' },
224224
resource: 'posts',
225225
},
226-
{ snapshot: [] }
226+
{ snapshot: [] },
227+
expect.anything()
227228
);
228229
});
229230
await waitFor(() => {
@@ -276,7 +277,8 @@ describe('<DeleteWithConfirmButton />', () => {
276277
previousData: { id: 123, title: 'lorem' },
277278
resource: 'posts',
278279
},
279-
{ snapshot: [] }
280+
{ snapshot: [] },
281+
expect.anything()
280282
);
281283
});
282284
await waitFor(() => {

packages/ra-ui-materialui/src/button/DeleteWithUndoButton.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ describe('<DeleteWithUndoButton />', () => {
107107
previousData: { id: 123, title: 'lorem' },
108108
resource: 'posts',
109109
},
110-
{ snapshot: [] }
110+
{ snapshot: [] },
111+
expect.anything()
111112
);
112113
});
113114
});

packages/ra-ui-materialui/src/button/SaveButton.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ describe('<SaveButton />', () => {
177177
resource: 'posts',
178178
meta: undefined,
179179
},
180-
{ snapshot: [] }
180+
{ snapshot: [] },
181+
expect.anything()
181182
);
182183
});
183184
});
@@ -230,7 +231,8 @@ describe('<SaveButton />', () => {
230231
resource: 'posts',
231232
meta: undefined,
232233
},
233-
{ snapshot: [] }
234+
{ snapshot: [] },
235+
expect.anything()
234236
);
235237
});
236238
});

packages/ra-ui-materialui/src/button/UpdateWithConfirmButton.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ describe('<UpdateWithConfirmButton />', () => {
207207
meta: undefined,
208208
resource: 'posts',
209209
},
210-
{ snapshot: expect.any(Array) }
210+
{ snapshot: expect.any(Array) },
211+
expect.anything()
211212
);
212213
});
213214
});
@@ -261,7 +262,8 @@ describe('<UpdateWithConfirmButton />', () => {
261262
meta: undefined,
262263
resource: 'posts',
263264
},
264-
{ snapshot: expect.any(Array) }
265+
{ snapshot: expect.any(Array) },
266+
expect.anything()
265267
);
266268
});
267269
});

packages/ra-ui-materialui/src/button/UpdateWithUndoButton.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ describe('<UpdateWithUndoButton />', () => {
101101
previousData: { id: 123, title: 'lorem', views: 500 },
102102
resource: 'posts',
103103
},
104-
{ snapshot: expect.any(Array) }
104+
{ snapshot: expect.any(Array) },
105+
expect.anything()
105106
);
106107
});
107108
});

0 commit comments

Comments
 (0)