Skip to content

Commit 981b732

Browse files
committed
Add ListGuesser empty-state test
1 parent e3f428e commit 981b732

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/ra-ui-materialui/src/list/ListGuesser.spec.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import * as React from 'react';
22
import expect from 'expect';
33
import { fireEvent, render, screen } from '@testing-library/react';
4-
import { ManyResources } from './ListGuesser.stories';
4+
import { Empty, ManyResources } from './ListGuesser.stories';
55

66
describe('<ListGuesser />', () => {
7+
it('should render an empty state dedicated to guessers', async () => {
8+
render(<Empty />);
9+
10+
await screen.findByText('No data to display');
11+
expect(
12+
screen.getByText('Please check your data provider')
13+
).toBeTruthy();
14+
});
15+
716
it('should log the guessed List views based on the fetched records', async () => {
817
const logSpy = jest.spyOn(console, 'log').mockImplementation(() => {});
918
render(<ManyResources />);

0 commit comments

Comments
 (0)