Skip to content

Commit e2b14a9

Browse files
committed
Fix and cleanup tests
1 parent 1654275 commit e2b14a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ describe('useCreate', () => {
202202

203203
describe('mutationMode', () => {
204204
it('when pessimistic, displays result and success side effects when dataProvider promise resolves', async () => {
205+
jest.spyOn(console, 'error').mockImplementation(() => {});
205206
render(<SuccessCasePessimistic timeout={10} />);
206207
screen.getByText('Create post').click();
207208
await waitFor(() => {
@@ -230,7 +231,7 @@ describe('useCreate', () => {
230231
expect(
231232
screen.queryByText('something went wrong')
232233
).not.toBeNull();
233-
expect(screen.queryByText('nothing yet')).toBeNull();
234+
expect(screen.queryByText('nothing yet')).not.toBeNull();
234235
expect(screen.queryByText('mutating')).toBeNull();
235236
});
236237
});

0 commit comments

Comments
 (0)