feat: migrate static pages to native tabbar

This commit is contained in:
2026-04-23 21:25:24 +08:00
parent f3cd0c3a98
commit cd30f57f2c
116 changed files with 7143 additions and 311 deletions

View File

@@ -0,0 +1,43 @@
describe('profile page', () => {
afterEach(() => {
delete global.Page
delete global.wx
jest.resetModules()
})
test('exposes static profile sections and navigable shortcuts', () => {
let capturedPageConfig
global.Page = config => {
capturedPageConfig = config
}
global.wx = {
navigateTo: jest.fn()
}
const profilePageModule = require('../pages/profile/index')
const pageData = profilePageModule.createProfilePageData()
expect(pageData.userCard.title).toBe('点击登录')
expect(pageData.assetItems).toHaveLength(4)
expect(pageData.moreItems).toEqual(
expect.arrayContaining([
expect.objectContaining({ key: 'learning-center', title: '学习中心' }),
expect.objectContaining({ key: 'ai-history', title: 'AI历史' })
])
)
capturedPageConfig.handleMoreTap({
currentTarget: {
dataset: {
route: '/packages/learning/pages/center/index'
}
}
})
expect(global.wx.navigateTo).toHaveBeenCalledWith({
url: '/packages/learning/pages/center/index'
})
})
})