home-activity-category-layout.test.js 497 B

1234567891011121314
  1. import test from 'node:test'
  2. import assert from 'node:assert/strict'
  3. import fs from 'node:fs'
  4. import path from 'node:path'
  5. const homeFile = path.resolve('pages/home.vue')
  6. test('首页活动分类每页展示两行八个图标', () => {
  7. const source = fs.readFileSync(homeFile, 'utf8')
  8. assert.match(source, /const TYPEGRID_PAGE_SIZE\s*=\s*8/)
  9. assert.match(source, /\.typegrid-swiper\s*\{[\s\S]*?height:\s*360rpx/)
  10. assert.match(source, /\.typegrid-page\s*\{[\s\S]*?flex-wrap:\s*wrap/)
  11. })