Skip to content

Commit

Permalink
test(nav-bar): override
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe committed Apr 25, 2024
1 parent e1419f7 commit d33fb4b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/nav-bar/tests/nav-bar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,25 @@ describe('NavBar', () => {
expect(baseElement.querySelector('.antd-mobile-icon')).toBeTruthy()
})

it('legacy', () => {
const { baseElement } = render(<NavBar backArrow>Title</NavBar>)
expect(baseElement.querySelector('.antd-mobile-icon')).toBeTruthy()
})

it('props', () => {
render(<NavBar backIcon='bamboo'>Title</NavBar>)
expect(screen.getByText('bamboo')).toBeVisible()
})

it('props override legacy props', () => {
render(
<NavBar backArrow='little' backIcon='bamboo'>
Title
</NavBar>
)
expect(screen.getByText('bamboo')).toBeVisible()
})

it('context', () => {
render(
<ConfigProvider navBar={{ backIcon: 'little' }}>
Expand Down

0 comments on commit d33fb4b

Please sign in to comment.