From afc2bdcdb841a00bb426dfbe364c88c8f8b4ee58 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Sun, 23 May 2021 10:39:06 -0300 Subject: [PATCH] Fix errors in tests --- .../src/button/SaveButton.spec.tsx | 33 ++++++++++++++----- .../src/field/ArrayField.spec.tsx | 4 ++- .../ra-ui-materialui/src/list/List.spec.tsx | 9 +++-- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx b/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx index 5ec4bc7c2a6..b1e27d4ea48 100644 --- a/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx +++ b/packages/ra-ui-materialui/src/button/SaveButton.spec.tsx @@ -56,7 +56,9 @@ describe('', () => { - + + + @@ -75,7 +77,9 @@ describe('', () => { - + + + @@ -87,7 +91,9 @@ describe('', () => { const { getByLabelText } = render( - + + + ); @@ -100,7 +106,9 @@ describe('', () => { const { getByLabelText } = render( - + + + ); @@ -135,7 +143,12 @@ describe('', () => { const { getByLabelText } = render( - + + + ); @@ -154,10 +167,12 @@ describe('', () => { dispatchSpy = jest.spyOn(store, 'dispatch'); return ( - + + + ); }} diff --git a/packages/ra-ui-materialui/src/field/ArrayField.spec.tsx b/packages/ra-ui-materialui/src/field/ArrayField.spec.tsx index d5beeb5dd35..86edf726eb6 100644 --- a/packages/ra-ui-materialui/src/field/ArrayField.spec.tsx +++ b/packages/ra-ui-materialui/src/field/ArrayField.spec.tsx @@ -8,8 +8,10 @@ import TextField from './TextField'; import Datagrid from '../list/datagrid/Datagrid'; describe('', () => { + const currentSort = { field: 'id', order: 'ASC' }; + const DummyIterator = props => ( - + diff --git a/packages/ra-ui-materialui/src/list/List.spec.tsx b/packages/ra-ui-materialui/src/list/List.spec.tsx index 2453c44bcba..7b3136e6fb0 100644 --- a/packages/ra-ui-materialui/src/list/List.spec.tsx +++ b/packages/ra-ui-materialui/src/list/List.spec.tsx @@ -50,7 +50,8 @@ describe('', () => { - + , + defaultStateForList ); expect(container.querySelectorAll('.list-page')).toHaveLength(1); }); @@ -70,7 +71,8 @@ describe('', () => { - + , + defaultStateForList ); expect(queryAllByText('filters')).toHaveLength(2); expect(queryAllByLabelText('ra.action.export')).toHaveLength(1); @@ -86,7 +88,8 @@ describe('', () => { }> - + , + defaultStateForList ); expect(queryAllByText('Hello')).toHaveLength(1); });