import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import test from 'node:test' const desktop = readFileSync(new URL('../src/views/pl/plan-quota/index.vue', import.meta.url), 'utf8') const mobile = readFileSync(new URL('../src/views/m/pl/plan-cert/PlanTab.vue', import.meta.url), 'utf8') test('plan cert lists mark a conversion row and keep the view action', () => { for (const source of [desktop, mobile]) { assert.match(source, /needsUnitConversion/) assert.match(source, /需单位换算/) assert.match(source, /查看用证/) } assert.match(desktop, /quota-conversion-row/) assert.match(mobile, /is-conversion/) assert.match(desktop, /查看全部/) assert.match(desktop, /conversionOnly: showAll\.value \? undefined : true/) const shell = readFileSync(new URL('../src/views/m/pl/plan-cert/index.vue', import.meta.url), 'utf8') assert.match(shell, /查看全部/) assert.match(shell, /show-all="showAllPlans"/) assert.match(mobile, /conversionOnly: props\.showAll \? undefined : true/) })