{back !== null && (
- {(backIcon || backArrow) && (
+ {mergedBackIcon && (
- {backIcon === true || backArrow === true
- ? componentConfig.backIcon ||
- : backIcon || backArrow}
+ {mergedBackIcon}
)}
{back}
diff --git a/src/components/nav-bar/tests/nav-bar.test.tsx b/src/components/nav-bar/tests/nav-bar.test.tsx
index dc2791733a..31f2549e67 100644
--- a/src/components/nav-bar/tests/nav-bar.test.tsx
+++ b/src/components/nav-bar/tests/nav-bar.test.tsx
@@ -16,8 +16,10 @@ describe('NavBar', () => {
})
it('legacy', () => {
- const { baseElement } = render(Title)
- expect(baseElement.querySelector('.antd-mobile-icon')).toBeTruthy()
+ const { baseElement } = render(
+ }>Title
+ )
+ expect(baseElement.querySelector('.bamboo')).toBeTruthy()
})
it('props', () => {
@@ -35,23 +37,23 @@ describe('NavBar', () => {
})
it('context', () => {
- render(
-
+ const { baseElement } = render(
+ }}>
Title
)
- expect(screen.getByText('little')).toBeVisible()
+ expect(baseElement.querySelector('.little')).toBeTruthy()
})
it('props override context', () => {
- render(
-
- Title
+ const { baseElement } = render(
+ }}>
+ }>Title
)
- expect(screen.getByText('bamboo')).toBeVisible()
+ expect(baseElement.querySelector('.bamboo')).toBeTruthy()
})
})
})