const assert = require('node:assert/strict') const fs = require('node:fs') const path = require('node:path') const root = path.resolve(__dirname, '..') const tabLayout = fs.readFileSync(path.join(root, 'src/layouts/TabLayout.vue'), 'utf8') const pageLayout = fs.readFileSync(path.join(root, 'src/layouts/PageLayout.vue'), 'utf8') const home = fs.readFileSync(path.join(root, 'src/pages/home/HomePage.vue'), 'utf8') const workbench = fs.readFileSync(path.join(root, 'src/pages/operator/OperatorWorkbenchPage.vue'), 'utf8') const serviceDetail = fs.readFileSync(path.join(root, 'src/pages/operator/OperatorServiceDetailPage.vue'), 'utf8') const matchmakerApi = fs.readFileSync(path.join(root, 'src/api/services/matchmaker.ts'), 'utf8') const discover = fs.readFileSync(path.join(root, 'src/pages/discover/DiscoverPage.vue'), 'utf8') const userCard = fs.readFileSync(path.join(root, 'src/components/UiUserCard.vue'), 'utf8') const routes = fs.readFileSync(path.join(root, 'src/router/routes.ts'), 'utf8') assert.doesNotMatch(tabLayout, /to="\/messages"[^>]*>消息<\/van-tabbar-item>/) assert.match(tabLayout, /to="\/notifications"[^>]*>通知<\/van-tabbar-item>/) assert.match(pageLayout, /class="page-layout__nav"/) assert.match(home, /home-hero-v2\.jpg/) assert.match(home, /home__notice[^\n]*notifications/) assert.doesNotMatch(home, /home__banner-cover[^\n]*\{\{ \(b\.title \|\| '善'\)\.slice\(0, 1\) \}\}/) assert.match(workbench, /服务工作台/) assert.match(workbench, /v-for="item in filteredServices"/) assert.match(workbench, /activeServiceTab/) assert.match(workbench, /createDemoUser/) assert.match(workbench, /assignToSelf/) assert.match(workbench, /query: \{ id: serviceId, source \}/) assert.match(serviceDetail, /route\.query\.source === 'management'[\s\S]*?managementServiceDetail\(serviceId\)/) assert.match(matchmakerApi, /managementServiceDetail\(id: string\)[\s\S]*?\/operator\/matchmaker\/management\/services\//) assert.match(discover, /class="discover__hero"/) assert.match(discover, /placeholder="姓名、职业或地区"/) assert.match(discover, />推荐<|>年龄<|>学历<|>婚姻