Skip to content

Commit f69254b

Browse files
feat(312): support adding comment (#183)
1 parent 31794db commit f69254b

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,9 @@ await vrt.track({
151151
height: 400;
152152
}
153153
]
154+
155+
// Allow additional details
156+
// Optional
157+
comment: 'Ignoring region because of animation'
154158
});
155159
```

lib/helpers/dto.helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const multipartDtoToFormData = (dto: TestRunMultipartDto): FormData => {
2020
data.append("ignoreAreas", JSON.stringify(dto.ignoreAreas));
2121
dto.diffTollerancePercent &&
2222
data.append("diffTollerancePercent", dto.diffTollerancePercent);
23+
dto.comment && data.append("comment", dto.comment);
2324

2425
return data;
2526
};
@@ -40,6 +41,7 @@ export const bufferDtoToFormData = (dto: TestRunBufferDto): FormData => {
4041
data.append("ignoreAreas", JSON.stringify(dto.ignoreAreas));
4142
dto.diffTollerancePercent &&
4243
data.append("diffTollerancePercent", dto.diffTollerancePercent);
44+
dto.comment && data.append("comment", dto.comment);
4345

4446
return data;
4547
};

lib/types/request/testRun.dto.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ export interface TestRunDto {
2424
merge?: boolean;
2525

2626
ignoreAreas?: IgnoreArea[];
27+
28+
comment?: string;
2729
}

lib/types/testRun.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface TestRun {
99
customTags?: string;
1010
diffTollerancePercent?: number;
1111
ignoreAreas?: IgnoreArea[];
12+
comment?: string;
1213
}
1314

1415
export interface TestRunBase64 extends TestRun {

lib/visualRegressionTracker.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const testRunMultipart: TestRunMultipart = {
142142
width: 400,
143143
},
144144
],
145+
comment: "comment",
145146
};
146147

147148
const testRunBuffer: TestRunBuffer = {
@@ -160,6 +161,7 @@ const testRunBuffer: TestRunBuffer = {
160161
width: 400,
161162
},
162163
],
164+
comment: "comment",
163165
};
164166

165167
const testRunResponse: TestRunResponse = {

0 commit comments

Comments
 (0)