Skip to content

Commit

Permalink
feat(community-tabs): match layout to designs
Browse files Browse the repository at this point in the history
  • Loading branch information
mburtch authored and jraff committed Feb 3, 2021
1 parent 680fb74 commit 027bec6
Show file tree
Hide file tree
Showing 4 changed files with 323 additions and 201 deletions.
4 changes: 2 additions & 2 deletions packages/Tabs/Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ const Tabs = props => {
onKeyUp={e => handleTabsKeyUp(e)}
ref={tabNavRef}
>
<TabLabelContainer tabIndex={isActive && '-1'} isActive={isActive}>
<TabLabel>{tab.props.heading}</TabLabel>
<TabLabelContainer tabIndex={isActive && '-1'}>
<TabLabel wrapLabel={wrapLabels}>{tab.props.heading}</TabLabel>
</TabLabelContainer>
</Tab>
)
Expand Down
6 changes: 4 additions & 2 deletions packages/Tabs/__tests__/Tabs.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { mount } from 'enzyme'
import 'jest-styled-components'

import Tabs from '../Tabs'
import { TabLabel } from '../styles'

describe('Tabs', () => {
const doMount = (props = {}) =>
Expand Down Expand Up @@ -51,7 +52,8 @@ describe('Tabs', () => {

it('renders with multiline labels', () => {
const tabs = doMount({ wrapLabels: true })
const tab = tabs.find('.react-tabs__tab').first()
expect(tab).toHaveStyleRule({ 'max-width': '180px' })
const tabLabel = tabs.find(TabLabel).first()
expect(tabs).toHaveProp('wrapLabels', true)
expect(tabLabel).toHaveStyleRule('max-width', '144px')
})
})

0 comments on commit 027bec6

Please sign in to comment.