Skip to content

Commit b883137

Browse files
committed
Stabilize tests
1 parent 6607d2a commit b883137

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('useCreate', () => {
9999
});
100100
});
101101

102-
it('accepts a meta paramater', async () => {
102+
it('accepts a meta parameter', async () => {
103103
const dataProvider = testDataProvider({
104104
create: jest.fn(() => Promise.resolve({ data: { id: 1 } } as any)),
105105
});
@@ -236,18 +236,19 @@ describe('useCreate', () => {
236236
});
237237
});
238238
it('when optimistic, displays result and success side effects right away', async () => {
239+
jest.spyOn(console, 'error').mockImplementation(() => {});
239240
render(<SuccessCaseOptimistic timeout={10} />);
240241
screen.getByText('Create post').click();
241242
await waitFor(() => {
242-
expect(screen.queryByText('success')).not.toBeNull();
243-
expect(screen.queryByText('Hello World')).not.toBeNull();
244243
expect(screen.queryByText('mutating')).not.toBeNull();
245244
});
245+
expect(screen.queryByText('success')).not.toBeNull();
246+
expect(screen.queryByText('Hello World')).not.toBeNull();
246247
await waitFor(() => {
247-
expect(screen.queryByText('success')).not.toBeNull();
248-
expect(screen.queryByText('Hello World')).not.toBeNull();
249248
expect(screen.queryByText('mutating')).toBeNull();
250249
});
250+
expect(screen.queryByText('success')).not.toBeNull();
251+
expect(screen.queryByText('Hello World')).not.toBeNull();
251252
});
252253
it('when optimistic, displays error and error side effects when dataProvider promise rejects', async () => {
253254
jest.spyOn(console, 'error').mockImplementation(() => {});

0 commit comments

Comments
 (0)