Skip to content

Commit

Permalink
fix(help text): add title to helptext tests (#126)
Browse files Browse the repository at this point in the history
* add title to helptext test

* add mock svg for SvgIcon test
  • Loading branch information
Magnusrm authored Feb 2, 2023
1 parent d61d975 commit 9b3fc86
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module.exports = {
moduleNameMapper: {
'.(css|less|scss)$': 'identity-obj-proxy',
'\\.svg$': '<rootDir>/test/__mocks__/svg.ts',
},
preset: 'ts-jest',
testEnvironment: 'jsdom',
Expand Down
9 changes: 8 additions & 1 deletion packages/react/src/components/HelpText/HelpText.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ const render = (props: Partial<HelpTextProps> = {}) => {
const allProps = {
...props,
};
renderRtl(<HelpText {...allProps}>Help</HelpText>);
renderRtl(
<HelpText
title={'Helptext for test'}
{...allProps}
>
Help
</HelpText>,
);
};

const user = userEvent.setup();
Expand Down
2 changes: 2 additions & 0 deletions test/__mocks__/svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default 'SvgrURL';
export const ReactComponent = 'div';

0 comments on commit 9b3fc86

Please sign in to comment.