35 lines
1.6 KiB
JavaScript
35 lines
1.6 KiB
JavaScript
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')
|
|
})
|
|
})
|