Skip to content

Commit bbcbabe

Browse files
committed
TestRunResultDto. url changed
1 parent 3d26d66 commit bbcbabe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/dto/testRunResult.dto.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TestRun, TestStatus } from '@prisma/client';
1+
import { TestRun, TestStatus, TestVariation } from '@prisma/client';
22

33
export class TestRunResultDto {
44
id: string
@@ -10,14 +10,14 @@ export class TestRunResultDto {
1010
status: TestStatus;
1111
url: string;
1212

13-
constructor(testRun: TestRun) {
13+
constructor(testRun: TestRun, testVariation: TestVariation) {
1414
this.id = testRun.id
1515
this.imageName = testRun.imageName
1616
this.diffName = testRun.diffName
1717
this.diffPercent = testRun.diffPercent
1818
this.diffTollerancePercent = testRun.diffTollerancePercent
1919
this.pixelMisMatchCount = testRun.pixelMisMatchCount
2020
this.status = testRun.status
21-
this.url = `${process.env.APP_FRONTEND_URL}/test/${this.id}`
21+
this.url = `${process.env.APP_FRONTEND_URL}/${testVariation.projectId}?buildId=${testRun.buildId}&testId=${testRun.id}`
2222
}
2323
}

src/test/test.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class TestService {
3131

3232
const testRun = await this.testRunsService.create(testVariation, createTestRequestDto);
3333

34-
return new TestRunResultDto(testRun);
34+
return new TestRunResultDto(testRun, testVariation);
3535
}
3636

3737
async deleteTestRun(id: string): Promise<TestRun> {

0 commit comments

Comments
 (0)