| 1234567891011121314151617181920212223 |
- import assert from 'node:assert/strict'
- import fs from 'node:fs'
- import path from 'node:path'
- import test from 'node:test'
- const pageFile = path.resolve('pagesHome/allActivity.vue')
- test('全部活动提供默认全部的活动状态筛选并映射接口状态', () => {
- const source = fs.readFileSync(pageFile, 'utf8')
- assert.match(source, /活动状态/)
- assert.match(source, /const status\s*=\s*ref\(['"]活动状态['"]\)/)
- assert.match(source, /const statusValue\s*=\s*ref\(['"]['"]\)/)
- assert.match(source, /statusOptions/)
- assert.match(source, /报名中/)
- assert.match(source, /报名已截止/)
- assert.match(source, /已结束/)
- assert.match(source, /activeState:\s*''/)
- assert.match(source, /['"]报名中['"]\s*,?\s*value:\s*1/)
- assert.match(source, /['"]报名已截止['"]\s*,?\s*value:\s*2/)
- assert.match(source, /['"]已结束['"]\s*,?\s*value:\s*3/)
- assert.match(source, /changeStatus/)
- })
|