From 6607d2af0fb8c95eede07f374004a91a80560873 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Fri, 20 Jun 2025 10:55:52 +0200 Subject: [PATCH 1/3] [Doc] Update `` regarding limitation with old versions of react-admin --- docs/CreateDialog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CreateDialog.md b/docs/CreateDialog.md index c829a9f9613..c0850f1068a 100644 --- a/docs/CreateDialog.md +++ b/docs/CreateDialog.md @@ -66,7 +66,7 @@ In the related ``, you don't need to declare a `create` component as t ``` -**Note**: You can't use the `` and have a standard `` specified on your ``, because the `` declarations would conflict. If you need this, use the [``](./CreateInDialogButton.md) instead. +**Note**: If you use a react-admin version older than `5.8.5`, you can't have both a `` and a standard `` specified on your ``, because the `` declarations would conflict. If you need this, use the `` instead. ## Props From b8831379a62750876fc1466d3b7810dd92bd57f3 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Fri, 20 Jun 2025 11:14:38 +0200 Subject: [PATCH 2/3] Stabilize tests --- packages/ra-core/src/dataProvider/useCreate.spec.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/ra-core/src/dataProvider/useCreate.spec.tsx b/packages/ra-core/src/dataProvider/useCreate.spec.tsx index 5dd522e0390..cdcbd63686a 100644 --- a/packages/ra-core/src/dataProvider/useCreate.spec.tsx +++ b/packages/ra-core/src/dataProvider/useCreate.spec.tsx @@ -99,7 +99,7 @@ describe('useCreate', () => { }); }); - it('accepts a meta paramater', async () => { + it('accepts a meta parameter', async () => { const dataProvider = testDataProvider({ create: jest.fn(() => Promise.resolve({ data: { id: 1 } } as any)), }); @@ -236,18 +236,19 @@ describe('useCreate', () => { }); }); it('when optimistic, displays result and success side effects right away', async () => { + jest.spyOn(console, 'error').mockImplementation(() => {}); render(); screen.getByText('Create post').click(); await waitFor(() => { - expect(screen.queryByText('success')).not.toBeNull(); - expect(screen.queryByText('Hello World')).not.toBeNull(); expect(screen.queryByText('mutating')).not.toBeNull(); }); + expect(screen.queryByText('success')).not.toBeNull(); + expect(screen.queryByText('Hello World')).not.toBeNull(); await waitFor(() => { - expect(screen.queryByText('success')).not.toBeNull(); - expect(screen.queryByText('Hello World')).not.toBeNull(); expect(screen.queryByText('mutating')).toBeNull(); }); + expect(screen.queryByText('success')).not.toBeNull(); + expect(screen.queryByText('Hello World')).not.toBeNull(); }); it('when optimistic, displays error and error side effects when dataProvider promise rejects', async () => { jest.spyOn(console, 'error').mockImplementation(() => {}); From aafa5f65ef5932747c26a8bbd55661f39606368b Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:12:40 +0200 Subject: [PATCH 3/3] Fix version in documentation [no ci] --- docs/CreateDialog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CreateDialog.md b/docs/CreateDialog.md index c0850f1068a..6495847d594 100644 --- a/docs/CreateDialog.md +++ b/docs/CreateDialog.md @@ -66,7 +66,7 @@ In the related ``, you don't need to declare a `create` component as t ``` -**Note**: If you use a react-admin version older than `5.8.5`, you can't have both a `` and a standard `` specified on your ``, because the `` declarations would conflict. If you need this, use the `` instead. +**Note**: If you use a react-admin version older than `5.9.0`, you can't have both a `` and a standard `` specified on your ``, because the `` declarations would conflict. If you need this, use the `` instead. ## Props