activity-list-category.test.js 562 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 listFile = path.resolve('src/views/modules/activity/list.vue')
  6. test('活动列表展示全部多选活动分类并兼容旧数据', () => {
  7. const source = fs.readFileSync(listFile, 'utf8')
  8. assert.match(source, /getCategoryNames\(scope\.row\)/)
  9. assert.match(source, /categoryIds/)
  10. assert.match(source, /getCategoryNames\s*\(activity\)/)
  11. assert.match(source, /categoryId/)
  12. assert.match(source, /join\(['"]、['"]\)/)
  13. })