const fs = require('fs') const path = require('path') describe('library page compatibility', () => { test('renders category navigation and book cards with compatible layout primitives', () => { const wxml = fs.readFileSync(path.join(process.cwd(), 'pages/library/index.wxml'), 'utf8') const wxss = fs.readFileSync(path.join(process.cwd(), 'pages/library/index.wxss'), 'utf8') expect(wxml).not.toContain('placeholder-page') expect(wxml).toContain('library-page__sidebar') expect(wxml).toContain('library-page__category') expect(wxml).toContain('wx:for="{{categories}}"') expect(wxml).toContain('bindtap="handleCategoryTap"') expect(wxml).toContain('{{currentCategoryName}}') expect(wxml).toContain('wx:for="{{visibleBooks}}"') expect(wxml).toContain('book-card__cover-char') expect(wxml).toContain('bindtap="handleSearchTap"') expect(wxml).toContain('{{domainBridge.title}}') expect(wxml).toContain('bindtap="handleDomainBridgeTap"') expect(wxss).not.toContain('display: grid') expect(wxss).not.toContain('gap:') expect(wxss).toContain('.library-page__sidebar') expect(wxss).toContain('.library-page__category--active') expect(wxss).toContain('.book-card') expect(wxss).toContain('.book-card__meta') expect(wxss).toContain('.library-page__bridge') }) })