Skip to content

Commit

Permalink
refactor(components): update height prop in InfoScreen (#17236)
Browse files Browse the repository at this point in the history
* refactor(components): update height prop in InfoScreen
  • Loading branch information
koji authored Jan 14, 2025
1 parent 8ed9feb commit 9b3b33f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
16 changes: 16 additions & 0 deletions components/src/molecules/InfoScreen/__tests__/InfoScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,21 @@ describe('InfoScreen', () => {
expect(screen.getByLabelText('alert')).toHaveStyle(
`color: ${COLORS.grey60}`
)
expect(screen.getByTestId('InfoScreen')).toHaveStyle(`height: 100%`)
})

it('should render set height, subContent and backgroundColor', () => {
props = {
...props,
subContent: 'mock sub content',
backgroundColor: COLORS.blue50,
height: '10rem',
}
render(props)
screen.getByText('mock sub content')
expect(screen.getByTestId('InfoScreen')).toHaveStyle(
`background-color: ${COLORS.blue50}`
)
expect(screen.getByTestId('InfoScreen')).toHaveStyle(`height: 10rem`)
})
})
2 changes: 1 addition & 1 deletion components/src/molecules/InfoScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function InfoScreen({
content,
subContent,
backgroundColor = COLORS.grey30,
height,
height = '100%',
}: InfoScreenProps): JSX.Element {
return (
<Flex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ export function LiquidToolbox(props: LiquidToolboxProps): JSX.Element {
<InfoScreen
content={t('no_liquids_defined')}
subContent={t('select_wells_to_add')}
height="100%"
/>
)}
</Toolbox>
Expand Down

0 comments on commit 9b3b33f

Please sign in to comment.