Files
xuanzhi-wx/tests/profile-page-render.test.js

25 lines
1.0 KiB
JavaScript

const fs = require('fs')
const path = require('path')
describe('profile page compatibility', () => {
test('renders the five static profile sections with route-first shortcuts', () => {
const wxml = fs.readFileSync(path.join(process.cwd(), 'pages/profile/index.wxml'), 'utf8')
const wxss = fs.readFileSync(path.join(process.cwd(), 'pages/profile/index.wxss'), 'utf8')
expect(wxml).not.toContain('placeholder-page')
expect(wxml).toContain('profile-page')
expect(wxml).toContain('{{userCard.title}}')
expect(wxml).toContain('{{vipCard.title}}')
expect(wxml).toContain('wx:for="{{assetItems}}"')
expect(wxml).toContain('bindtap="handleAssetTap"')
expect(wxml).toContain('{{recentRecord.emptyTitle}}')
expect(wxml).toContain('wx:for="{{moreItems}}"')
expect(wxml).toContain('bindtap="handleMoreTap"')
expect(wxss).toContain('.profile-page')
expect(wxss).toContain('.profile-header')
expect(wxss).toContain('.asset-grid')
expect(wxss).toContain('.menu-list')
})
})