From 2106b161c884175279afb4453009040d91cc01af Mon Sep 17 00:00:00 2001 From: Matheus Wichman Date: Fri, 29 Nov 2019 09:38:26 -0300 Subject: [PATCH] Add tests --- .../ra-ui-materialui/src/list/List.spec.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/ra-ui-materialui/src/list/List.spec.js b/packages/ra-ui-materialui/src/list/List.spec.js index c695ae2fe3a..e0be54b7f4b 100644 --- a/packages/ra-ui-materialui/src/list/List.spec.js +++ b/packages/ra-ui-materialui/src/list/List.spec.js @@ -110,4 +110,34 @@ describe('', () => { ); expect(queryAllByText('Hello')).toHaveLength(1); }); + + it('should render an invite when the list is empty', () => { + const Dummy = () =>
; + const { queryAllByText } = renderWithRedux( + + + + + + ); + expect(queryAllByText('ra.page.empty')).toHaveLength(1); + }); + + it('should not render an invite when a filter is in use', () => { + const Dummy = () =>
; + const { queryAllByText } = renderWithRedux( + + + + + + ); + expect(queryAllByText('ra.page.empty')).toHaveLength(0); + }); });