Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

21 lignes
1.4 KiB

  1. import assert from 'node:assert/strict'
  2. import test from 'node:test'
  3. import { matchesSceneScreenshotAttachment, isSceneUnitProof } from './scene-editor-report-evidence.mjs'
  4. test('extensionless Playwright attachment name associates with the original PNG', () => {
  5. assert.equal(matchesSceneScreenshotAttachment('33-fox.png', { name: '33-fox', path: 'attachments/33-fox-<hash>.png' }), true)
  6. })
  7. test('exact filename and portable Windows attachment path are recognized', () => {
  8. assert.equal(matchesSceneScreenshotAttachment('33-fox.png', { name: '33-fox.png' }), true)
  9. assert.equal(matchesSceneScreenshotAttachment('33-fox.png', { name: 'screenshot', path: 'E:\\report\\screenshots\\33-fox.png' }), true)
  10. })
  11. test('neighboring names never become a screenshot association', () => {
  12. assert.equal(matchesSceneScreenshotAttachment('33-fox.png', { name: '33-fox-failure', path: 'attachments/failure.png' }), false)
  13. assert.equal(matchesSceneScreenshotAttachment('33-fox.png', { name: '34-truck' }), false)
  14. })
  15. test('unit titles remain unit evidence and browser titles use the final Playwright run', () => {
  16. assert.equal(isSceneUnitProof({ kind: 'unit', testTitle: 'unit case' }), true)
  17. assert.equal(isSceneUnitProof({ kind: 'api', testTitle: 'API contract' }), true)
  18. assert.equal(isSceneUnitProof({ kind: 'browser', testTitle: 'UI case' }), false)
  19. assert.equal(isSceneUnitProof({ kind: '真实UI+只读投影', testTitle: 'UI case' }), false)
  20. })