Skip to content

Commit bf8b9c4

Browse files
authoredSep 3, 2021
feat: customTags optional field added (#153)
1 parent 603ea18 commit bf8b9c4

File tree

8 files changed

+32
-0
lines changed

8 files changed

+32
-0
lines changed
 

‎README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ await vrt.track({
127127
// Optional
128128
device: "PC",
129129

130+
// Optional
131+
customTags: "Cloud, DarkTheme, Auth",
132+
130133
// Array of areas to be ignored
131134
// Optional
132135
ignoreAreas: [

‎lib/helpers/__snapshots__/dto.helper.spec.ts.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ FormData {
6868
"device",
6969
"device",
7070
],
71+
Array [
72+
"customTags",
73+
"customTags",
74+
],
7175
Array [
7276
"ignoreAreas",
7377
"[{\\"x\\":1,\\"y\\":2,\\"height\\":300,\\"width\\":400}]",
@@ -122,6 +126,10 @@ FormData {
122126
"type": "return",
123127
"value": undefined,
124128
},
129+
Object {
130+
"type": "return",
131+
"value": undefined,
132+
},
125133
],
126134
},
127135
"destroy": [MockFunction],
@@ -321,6 +329,10 @@ FormData {
321329
"device",
322330
"device",
323331
],
332+
Array [
333+
"customTags",
334+
"customTags",
335+
],
324336
Array [
325337
"ignoreAreas",
326338
"[{\\"x\\":1,\\"y\\":2,\\"height\\":300,\\"width\\":400}]",
@@ -375,6 +387,10 @@ FormData {
375387
"type": "return",
376388
"value": undefined,
377389
},
390+
Object {
391+
"type": "return",
392+
"value": undefined,
393+
},
378394
],
379395
},
380396
"destroy": [MockFunction],

‎lib/helpers/dto.helper.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe("multipartDtoToFormData", () => {
1919
imagePath: "./lib/__data__/2.png",
2020
os: "os",
2121
device: "device",
22+
customTags: "customTags",
2223
viewport: "viewport",
2324
browser: "browser",
2425
diffTollerancePercent: 0.123,
@@ -64,6 +65,7 @@ describe("bufferDtoToFormData", () => {
6465
imageBuffer: Buffer.of(1, 2, 3),
6566
os: "os",
6667
device: "device",
68+
customTags: "customTags",
6769
viewport: "viewport",
6870
browser: "browser",
6971
diffTollerancePercent: 0.123,

‎lib/helpers/dto.helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const multipartDtoToFormData = (dto: TestRunMultipartDto): FormData => {
1515
dto.browser && data.append("browser", dto.browser);
1616
dto.viewport && data.append("viewport", dto.viewport);
1717
dto.device && data.append("device", dto.device);
18+
dto.customTags && data.append("customTags", dto.customTags);
1819
dto.ignoreAreas &&
1920
data.append("ignoreAreas", JSON.stringify(dto.ignoreAreas));
2021
dto.diffTollerancePercent &&
@@ -34,6 +35,7 @@ export const bufferDtoToFormData = (dto: TestRunBufferDto): FormData => {
3435
dto.browser && data.append("browser", dto.browser);
3536
dto.viewport && data.append("viewport", dto.viewport);
3637
dto.device && data.append("device", dto.device);
38+
dto.customTags && data.append("customTags", dto.customTags);
3739
dto.ignoreAreas &&
3840
data.append("ignoreAreas", JSON.stringify(dto.ignoreAreas));
3941
dto.diffTollerancePercent &&

‎lib/helpers/type.helper.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe("instanceOfTestRunBase64", () => {
99
imagePath: "iamge",
1010
os: "os",
1111
device: "device",
12+
customTags: "customTags",
1213
viewport: "viewport",
1314
browser: "browser",
1415
},
@@ -20,6 +21,7 @@ describe("instanceOfTestRunBase64", () => {
2021
imageBase64: "iamge",
2122
os: "os",
2223
device: "device",
24+
customTags: "customTags",
2325
viewport: "viewport",
2426
browser: "browser",
2527
},

‎lib/types/request/testRun.dto.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export interface TestRunDto {
1111

1212
device?: string;
1313

14+
customTags?: string;
15+
1416
branchName: string;
1517

1618
buildId: string;

‎lib/types/testRun.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface TestRun {
66
browser?: string;
77
viewport?: string;
88
device?: string;
9+
customTags?: string;
910
diffTollerancePercent?: number;
1011
ignoreAreas?: IgnoreArea[];
1112
}

‎lib/visualRegressionTracker.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const testRunBase64: TestRunBase64 = {
113113
imageBase64: "iamge",
114114
os: "os",
115115
device: "device",
116+
customTags: "customTags",
116117
viewport: "viewport",
117118
browser: "browser",
118119
ignoreAreas: [
@@ -130,6 +131,7 @@ const testRunMultipart: TestRunMultipart = {
130131
imagePath: "./lib/__data__/2.png",
131132
os: "os",
132133
device: "device",
134+
customTags: "customTags",
133135
viewport: "viewport",
134136
browser: "browser",
135137
ignoreAreas: [
@@ -147,6 +149,7 @@ const testRunBuffer: TestRunBuffer = {
147149
imageBuffer: Buffer.of(1, 2, 3),
148150
os: "os",
149151
device: "device",
152+
customTags: "customTags",
150153
viewport: "viewport",
151154
browser: "browser",
152155
ignoreAreas: [
@@ -437,6 +440,7 @@ describe("VisualRegressionTracker", () => {
437440
imageBase64: testRunBase64.imageBase64,
438441
os: testRunBase64.os,
439442
device: testRunBase64.device,
443+
customTags: testRunBase64.customTags,
440444
viewport: testRunBase64.viewport,
441445
browser: testRunBase64.browser,
442446
ignoreAreas: testRunBase64.ignoreAreas,

0 commit comments

Comments
 (0)