import assert from 'node:assert/strict' import test from 'node:test' import { readFileSync } from 'node:fs' const read = name => readFileSync(new URL(`../../src/components/UserFeedback/${name}.vue`, import.meta.url), 'utf8') test('recipient settings and notification details remain administrator-only, outside menus', () => { const source = read('index') assert.match(source, / { const source = read('NotificationDetail') assert.match(source, /
\{\{ plan.body \}\}<\/pre>/)
  assert.doesNotMatch(source, /v-html|el-dialog/)
  assert.match(source, /确认发送邮件/)
  assert.match(source, /previewToken: plan.value.previewToken/)
  assert.match(source, /retryConfirmed/)
  assert.match(source, /onBeforeUnmount\(\(\) => \{ generation\+\+; clearTimeout\(timer\)/)
})
test('roles use current membership and auto-send has a clear opt-in warning', () => {
  const source = read('NotificationSettings')
  assert.match(source, /roleIds: item.roleIds/)
  assert.match(source, /管理员预览后发送/)
  assert.match(source, /保存即允许此模块的新反馈自动通知/)
  assert.match(source, /不会补发历史反馈/)
  assert.match(source, /只有管理员可查看全部反馈/)
})