import test from 'node:test' import assert from 'node:assert/strict' import fs from 'node:fs' import path from 'node:path' const areaFile = path.resolve('components/pages/activityArea/index.vue') const allActivityFile = path.resolve('pagesHome/allActivity.vue') test('区域弹窗提供重置入口并清空活动区域筛选', () => { const areaSource = fs.readFileSync(areaFile, 'utf8') const pageSource = fs.readFileSync(allActivityFile, 'utf8') assert.match(areaSource, /class="reset-btn"[^>]*@click="handleReset"[^>]*>重置/) assert.match(areaSource, /const handleReset = \(\) => \{[\s\S]*?emit\('reset'\)/) assert.match(pageSource, /<\/ActivityArea>/) assert.match(pageSource, /const areaReset = \(\) => \{[\s\S]*?districtId = ''[\s\S]*?placeShow\.value = false/) })