From 5bd57e71fd8551e5805cf56e9ff82a54867ff417 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 22 Jun 2021 21:12:06 +0200 Subject: [PATCH] Improved DropdownBtn test --- test/utils/DropdownBtn.test.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/utils/DropdownBtn.test.tsx b/test/utils/DropdownBtn.test.tsx index 2076f6ec..a8ee2012 100644 --- a/test/utils/DropdownBtn.test.tsx +++ b/test/utils/DropdownBtn.test.tsx @@ -38,4 +38,15 @@ describe('', () => { 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); + }); });