activity-detail-category.test.js 512 B

123456789101112131415
  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, /categoryIds/)
  10. assert.match(source, /categoryId/)
  11. assert.match(source, /join\(['"]、['"]\)/)
  12. })