Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw committed Nov 29, 2019
1 parent abc789e commit 2106b16
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/ra-ui-materialui/src/list/List.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,34 @@ describe('<List />', () => {
);
expect(queryAllByText('Hello')).toHaveLength(1);
});

it('should render an invite when the list is empty', () => {
const Dummy = () => <div />;
const { queryAllByText } = renderWithRedux(
<ThemeProvider theme={theme}>
<ListView {...defaultProps} total={0} hasCreate loaded>
<Dummy />
</ListView>
</ThemeProvider>
);
expect(queryAllByText('ra.page.empty')).toHaveLength(1);
});

it('should not render an invite when a filter is in use', () => {
const Dummy = () => <div />;
const { queryAllByText } = renderWithRedux(
<ThemeProvider theme={theme}>
<ListView
{...defaultProps}
filterValues={{ q: 'foo' }}
total={0}
hasCreate
loaded
>
<Dummy />
</ListView>
</ThemeProvider>
);
expect(queryAllByText('ra.page.empty')).toHaveLength(0);
});
});

0 comments on commit 2106b16

Please sign in to comment.