+
基本使用
+
+
+
+
通过名称匹配
+
+
+
+
徽标提示
+
+
+
+
自定义颜色
+
+
+
+
监听切换事件
+
+
+
+
监听点击事件
+
+
+
+
悬浮按钮
+
+
+
"
+`;
diff --git a/packages/varlet-vue2-ui/src/bottom-navigation/__tests__/index.spec.js b/packages/varlet-vue2-ui/src/bottom-navigation/__tests__/index.spec.js
new file mode 100644
index 00000000..74dd7914
--- /dev/null
+++ b/packages/varlet-vue2-ui/src/bottom-navigation/__tests__/index.spec.js
@@ -0,0 +1,234 @@
+import example from '../example'
+import BottomNavigation from '..'
+import BottomNavigationItem from '../../bottom-navigation-item'
+import VarBottomNavigation from '../BottomNavigation'
+import VarBottomNavigationItem from '../../bottom-navigation-item/BottomNavigationItem'
+import { mount } from '@vue/test-utils'
+import Vue from 'vue'
+import { delay } from '../../utils/jest'
+
+test('test bottom-navigation example', () => {
+ const wrapper = mount(example)
+
+ expect(wrapper.html()).toMatchSnapshot()
+
+ wrapper.destroy()
+})
+
+test('test bottom-navigation plugin', () => {
+ Vue.use(BottomNavigation).use(BottomNavigationItem)
+ expect(Vue.component(BottomNavigation.name)).toBeTruthy()
+})
+
+test('test bottom-navigation before-change prevent switch', async () => {
+ const onBeforeChange = jest.fn(() => false)
+ const Wrapper = {
+ components: {
+ [VarBottomNavigation.name]: VarBottomNavigation,
+ [VarBottomNavigationItem.name]: VarBottomNavigationItem,
+ },
+ props: ['onBeforeChange'],
+ data: () => ({
+ active: 0,
+ }),
+ template: `
+