Skip to content

Commit

Permalink
Unit 🧪
Browse files Browse the repository at this point in the history
  • Loading branch information
r100-stack committed Oct 11, 2024
1 parent 323e52a commit 33e35a4
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions packages/itwinui-react/src/core/RadioTiles/RadioTileGroup.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,48 @@ it('should render with label', () => {
expect(label).toBeTruthy();
expect(label.textContent).toBe('My tiles');
});

it('should apply all custom props', () => {
const { container } = render(
<RadioTileGroup
label='My tiles'
className='root-props'
labelProps={{
className: 'label-props',
}}
innerProps={{
className: 'inner-props',
}}
tileContainerProps={{
className: 'tile-container-props',
}}
messageProps={{
contentProps: {
className: 'message-content-props',
},
}}
message={'Message'}
>
<RadioTile />
<RadioTile />
</RadioTileGroup>,
);

expect(container.querySelector('.iui-input-grid.root-props')).toBeTruthy();
expect(
container.querySelector('.iui-input-grid > .iui-input-label.label-props'),
).toBeTruthy();
expect(
container.querySelector('.iui-input-grid > .iui-input-group.inner-props'),
).toBeTruthy();
expect(
container.querySelector(
'.iui-input-grid > .iui-input-group > .iui-radio-tile-container.tile-container-props',
),
).toBeTruthy();
expect(
container.querySelector(
'.iui-input-grid > .iui-status-message > .message-content-props',
),
).toBeTruthy();
});

0 comments on commit 33e35a4

Please sign in to comment.