Skip to content

Commit c366095

Browse files
committed
Improve tests
1 parent 25e5fc4 commit c366095

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

packages/ra-core/src/controller/list/ListBase.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ describe('ListBase', () => {
168168
});
169169
it('should render nothing while loading if emptyWhileLoading is set to true', async () => {
170170
render(<EmptyWhileLoading />);
171+
expect(screen.queryByText('Loading...')).toBeNull();
171172
expect(screen.queryByText('War and Peace')).toBeNull();
172173
fireEvent.click(screen.getByText('Resolve books loading'));
173174
await screen.findByText('War and Peace');

packages/ra-core/src/controller/list/ListBase.stories.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,13 @@ export const EmptyWhileLoadingRender = () => {
493493
resource="books"
494494
perPage={5}
495495
emptyWhileLoading
496-
render={({ data }) => {
497-
return (
498-
<ul>
499-
{data.map((record: any) => (
500-
<li key={record.id}>{record.title}</li>
501-
))}
502-
</ul>
503-
);
504-
}}
496+
render={({ data }) => (
497+
<ul>
498+
{data.map((record: any) => (
499+
<li key={record.id}>{record.title}</li>
500+
))}
501+
</ul>
502+
)}
505503
/>
506504
</CoreAdminContext>
507505
);

0 commit comments

Comments
 (0)