diff --git a/packages/ra-ui-materialui/src/list/List.spec.tsx b/packages/ra-ui-materialui/src/list/List.spec.tsx index 8ea417c5d22..45a68f6e450 100644 --- a/packages/ra-ui-materialui/src/list/List.spec.tsx +++ b/packages/ra-ui-materialui/src/list/List.spec.tsx @@ -237,6 +237,36 @@ describe('', () => { screen.getByText('dummy'); }); }); + + it('should render the empty component when only a permanent filter is set', async () => { + const Dummy = () => { + const { isPending } = useListContext(); + return
{isPending ? 'loading' : 'dummy'}
; + }; + const CustomEmpty = () =>
Custom Empty
; + const dataProvider = { + getList: jest.fn(() => Promise.resolve({ data: [], total: 0 })), + } as any; + + render( + + + } + > + + + + + ); + + await waitFor(() => { + expect(screen.queryByText('dummy')).toBeNull(); + screen.getByText('Custom Empty'); + }); + }); }); it('should render a filter button/form combo when passed an element in filters', async () => {