activity-detail-category.test.js 584 B

12345678910111213141516
  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 detailFile = path.resolve('src/views/modules/activity/detail.vue')
  6. test('活动详情页展示全部多选活动分类并兼容旧数据', () => {
  7. const source = fs.readFileSync(detailFile, 'utf8')
  8. assert.match(source, /getCategoryNames\(basicForm\)/)
  9. assert.match(source, /basicForm:\s*\{[\s\S]*categoryIds:\s*['"]['"]/)
  10. assert.match(source, /categoryIds/)
  11. assert.match(source, /categoryId/)
  12. assert.match(source, /join\(['"]、['"]\)/)
  13. })