Improved DropdownBtn test

This commit is contained in:
Alejandro Celaya 2021-06-22 21:12:06 +02:00
parent c4ed838510
commit 5bd57e71fd

View file

@ -38,4 +38,15 @@ describe('<DropdownBtn />', () => {
expect(toggle.prop('className')?.trim()).toEqual(expectedClasses);
});
it.each([
[ 100, { minWidth: '100px' }],
[ 250, { minWidth: '250px' }],
[ undefined, {}],
])('renders proper styles when minWidth is provided', (minWidth, expectedStyle) => {
const wrapper = createWrapper({ text: '', minWidth });
const style = wrapper.find(DropdownMenu).prop('style');
expect(style).toEqual(expectedStyle);
});
});