test-payment-detail-dialog-layout.ts 858 B

123456789101112131415161718192021
  1. import assert from 'node:assert/strict'
  2. import { readFileSync } from 'node:fs'
  3. const componentUrl = new URL(
  4. '../src/components/business/sample-payment-detail-dialog/index.vue',
  5. import.meta.url
  6. )
  7. const source = readFileSync(componentUrl, 'utf8')
  8. assert.match(source, /width="min\(1200px, 90vw\)"/)
  9. assert.match(source, /class="detail-summary form-grid-4"/)
  10. assert.equal(source.match(/class="detail-tag"/g)?.length, 2)
  11. assert.match(source, /\.detail-tag\s*\{[^}]*align-self:\s*flex-start;[^}]*width:\s*fit-content;/s)
  12. assert.match(source, /<el-table-column label="操作" min-width="150" align="center" fixed="right">/)
  13. assert.match(source, /class="transfer-action-stack"/)
  14. assert.match(
  15. source,
  16. /\.transfer-action-stack\s*\{[^}]*display:\s*inline-flex;[^}]*flex-direction:\s*column;/s
  17. )
  18. console.log('payment detail dialog layout contract passed')