@@ -176,7 +176,7 @@ describe("evidence gallery", () => {
|
176 | 176 | expect(JSON.stringify(model)).not.toContain(repoRoot); |
177 | 177 | }); |
178 | 178 | |
179 | | -it("normalizes absolute declared artifact paths for gallery links", async () => { |
| 179 | +it("normalizes absolute source and declared artifact paths for gallery links", async () => { |
180 | 180 | const repoRoot = await createTempRepo(); |
181 | 181 | const outputDir = path.join(repoRoot, ".artifacts", "qa-e2e", "vitest"); |
182 | 182 | const artifactPath = path.join(outputDir, "absolute.log"); |
@@ -187,6 +187,13 @@ describe("evidence gallery", () => {
|
187 | 187 | title: "Absolute artifact path", |
188 | 188 | artifact: { kind: "log", path: artifactPath }, |
189 | 189 | }); |
| 190 | +evidence.entries[0] = { |
| 191 | + ...evidence.entries[0], |
| 192 | +test: { |
| 193 | + ...evidence.entries[0].test, |
| 194 | +source: { path: path.join(repoRoot, "extensions/qa-lab/src/absolute.test.ts") }, |
| 195 | +}, |
| 196 | +}; |
190 | 197 | await writeJson(path.join(outputDir, QA_EVIDENCE_FILENAME), evidence); |
191 | 198 | |
192 | 199 | const model = await buildQaEvidenceGalleryModel({ |
@@ -203,6 +210,7 @@ describe("evidence gallery", () => {
|
203 | 210 | expect(artifact?.href).toContain( |
204 | 211 | "artifactPath=%3Crepo-root%3E%2F.artifacts%2Fqa-e2e%2Fvitest%2Fabsolute.log", |
205 | 212 | ); |
| 213 | +expect(model.entries[0]?.sourcePath).toBe("extensions/qa-lab/src/absolute.test.ts"); |
206 | 214 | expect(JSON.stringify(model)).not.toContain(repoRoot); |
207 | 215 | await expect( |
208 | 216 | resolveQaEvidenceArtifactFile({ |
|