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,34 @@
const fs = require('fs')
const path = require('path')
describe('ai page compatibility', () => {
test('renders tab panels with compatible layout primitives', () => {
const wxml = fs.readFileSync(path.join(process.cwd(), 'pages/ai/index.wxml'), 'utf8')
const wxss = fs.readFileSync(path.join(process.cwd(), 'pages/ai/index.wxss'), 'utf8')
expect(wxml).not.toContain('placeholder-page')
expect(wxml).toContain('ai-page')
expect(wxml).toContain('ai-page__title')
expect(wxml).toContain('wx:for="{{tabs}}"')
expect(wxml).toContain('bindtap="handleTabTap"')
expect(wxml).toContain('{{currentPanel.badge}}')
expect(wxml).toContain('{{currentPanel.heading}}')
expect(wxml).toContain('wx:for="{{currentPanel.highlights}}"')
expect(wxml).toContain('wx:for="{{currentPanel.examples}}"')
expect(wxml).toContain('wx:if="{{currentPanel.formType === \'qa\'}}"')
expect(wxml).toContain('wx:if="{{currentPanel.formType === \'analysis\'}}"')
expect(wxml).toContain('wx:if="{{currentPanel.formType === \'constitution\'}}"')
expect(wxml).toContain('bindtap="handleActionTap"')
expect(wxml).toContain('wx:for="{{secondaryEntries}}"')
expect(wxml).toContain('bindtap="handleSecondaryEntryTap"')
expect(wxss).not.toContain('display: grid')
expect(wxss).not.toContain('gap:')
expect(wxss).toContain('.ai-page__tabs')
expect(wxss).toContain('.ai-page__tab--active')
expect(wxss).toContain('.panel-card')
expect(wxss).toContain('.action-card')
expect(wxss).toContain('.example-chip')
expect(wxss).toContain('.ai-page__secondary-list')
})
})