mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-13 11:03:50 +00:00
Fixed warnings in SortingDropdown
This commit is contained in:
@@ -76,21 +76,22 @@ describe('<SortingDropdown />', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[{ isButton: false }, '>Order by<' ],
|
[{ isButton: false }, <>Order by</> ],
|
||||||
[{ isButton: true }, '>Order by...<' ],
|
[{ isButton: true }, <>Order by...</> ],
|
||||||
[
|
[
|
||||||
{ isButton: true, orderField: 'foo', orderDir: 'ASC' as OrderDir },
|
{ isButton: true, orderField: 'foo', orderDir: 'ASC' as OrderDir },
|
||||||
'Order by: "Foo" - "ASC"',
|
'Order by: "Foo" - "ASC"',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{ isButton: true, orderField: 'baz', orderDir: 'DESC' as OrderDir },
|
{ 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) => {
|
])('displays expected text in toggle', (props, expectedText) => {
|
||||||
const wrapper = createWrapper(props);
|
const wrapper = createWrapper(props);
|
||||||
const toggle = wrapper.find(DropdownToggle);
|
const toggle = wrapper.find(DropdownToggle);
|
||||||
|
const [ children ] = (toggle.prop('children') as any[]).filter(Boolean);
|
||||||
|
|
||||||
expect(toggle.html()).toContain(expectedText);
|
expect(children).toEqual(expectedText);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user