From 277069a0af2da924b82ec3066a0c8ddb8b042fe3 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 24 Jan 2021 18:06:37 +0100 Subject: [PATCH] Fixed warnings in SortingDropdown --- test/utils/SortingDropdown.test.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/utils/SortingDropdown.test.tsx b/test/utils/SortingDropdown.test.tsx index 6b3f9682..4f85c013 100644 --- a/test/utils/SortingDropdown.test.tsx +++ b/test/utils/SortingDropdown.test.tsx @@ -76,21 +76,22 @@ describe('', () => { }); it.each([ - [{ isButton: false }, '>Order by<' ], - [{ isButton: true }, '>Order by...<' ], + [{ isButton: false }, <>Order by ], + [{ isButton: true }, <>Order by... ], [ { isButton: true, orderField: 'foo', orderDir: 'ASC' as OrderDir }, - 'Order by: "Foo" - "ASC"', + 'Order by: "Foo" - "ASC"', ], [ { isButton: true, orderField: 'baz', orderDir: 'DESC' as OrderDir }, - 'Order by: "Hello World" - "DESC"', + 'Order by: "Hello World" - "DESC"', ], - [{ isButton: true, orderField: 'baz' }, 'Order by: "Hello World" - "DESC"' ], + [{ isButton: true, orderField: 'baz' }, 'Order by: "Hello World" - "DESC"' ], ])('displays expected text in toggle', (props, expectedText) => { const wrapper = createWrapper(props); const toggle = wrapper.find(DropdownToggle); + const [ children ] = (toggle.prop('children') as any[]).filter(Boolean); - expect(toggle.html()).toContain(expectedText); + expect(children).toEqual(expectedText); }); });