Skip to content

Commit d2dc4f1

Browse files
committed
test(ui): fix test for dIconRight of button
1 parent 9e4339e commit d2dc4f1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/ui/src/components/button/Button.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const getTypeClass = (dType: DButtonProps['dType'], prefix = dPrefix) => {
1313
const getThemeClass = (dTheme: DButtonProps['dTheme'], prefix = 't') => {
1414
return `${prefix}-${dTheme || 'primary'}`;
1515
};
16-
const getOtherClass = (ots?: 'icon' | DSize | 'block' | DButtonProps['dVariant'] | 'icon-right', separator = '--', prefix = dPrefix) => {
16+
const getOtherClass = (ots?: 'icon' | DSize | 'block' | DButtonProps['dVariant'], separator = '--', prefix = dPrefix) => {
1717
return !ots ? `${prefix}button` : `${prefix}button${separator}${ots || ''}`;
1818
};
1919

@@ -191,7 +191,8 @@ describe('DButton', () => {
191191
</DButton>
192192
);
193193
const button = getByRole('button');
194-
expect(button.className.includes(getOtherClass('icon-right'))).toBe(true);
194+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
195+
expect(button.children.item(0)!.innerHTML.includes('Hello World')).toBe(true);
195196
});
196197
});
197198

0 commit comments

Comments
 (0)