1- import { Project , TestRun , User } from "../types" ;
1+ import { Build , Project , TestRun , TestVariation , User } from "../types" ;
2+ import { BuildStatus } from "../types/buildStatus" ;
23import { TestStatus } from "../types/testStatus" ;
34
4- export const projectMock : Project = {
5+ export const TEST_PROJECT : Project = {
56 id : "someProjectId" ,
67 name : "Project name" ,
78 mainBranchName : "Main branch name" ,
@@ -10,7 +11,7 @@ export const projectMock: Project = {
1011 createdAt : "2020-09-14T06:57:25.845Z" ,
1112} ;
1213
13- export const userMock : User = {
14+ export const TEST_USER : User = {
1415 id : "1" ,
1516 token : 123567 ,
1617 apiKey : "SOME KEY SECRET" ,
@@ -41,3 +42,214 @@ export const testRunMock: TestRun = {
4142 baselineBranchName : "baselineBranchName" ,
4243 merge : false ,
4344} ;
45+
46+ export const TEST_VARIATION_ONE : TestVariation = {
47+ id : "testVariationId" ,
48+ name : "test run name" ,
49+ baselineName : "baselineName.png" ,
50+ os : "OS" ,
51+ browser : "browser" ,
52+ viewport : "viewport" ,
53+ device : "device" ,
54+ ignoreAreas : "[]" ,
55+ comment : "some comment" ,
56+ branchName : "branch name" ,
57+ projectId : TEST_PROJECT . id ,
58+ baselines : [
59+ {
60+ id : "some baseline id1" ,
61+ baselineName : "baseline1.png" ,
62+ testRunId : "testRunId1" ,
63+ testVariationId : "some test variation id" ,
64+ createdAt : "2020-09-14T06:57:25.845Z" ,
65+ updatedAt : "2020-09-14T06:57:25.845Z" ,
66+ testRun : testRunMock ,
67+ } ,
68+ {
69+ id : "some baseline id2" ,
70+ baselineName : "baseline2.png" ,
71+ testRunId : "testRunId2" ,
72+ testVariationId : "some test variation id" ,
73+ createdAt : "2020-09-12T06:57:25.845Z" ,
74+ updatedAt : "2020-09-12T06:57:25.845Z" ,
75+ testRun : testRunMock ,
76+ } ,
77+ ] ,
78+ } ;
79+
80+ export const TEST_VARIATION_TWO : TestVariation = {
81+ id : "some test variation id2" ,
82+ name : "test run name2" ,
83+ baselineName : "baseline2.png" ,
84+ os : "OS" ,
85+ browser : "browser" ,
86+ viewport : "viewport" ,
87+ device : "device" ,
88+ ignoreAreas : "[]" ,
89+ comment : "some comment" ,
90+ branchName : "branch name" ,
91+ projectId : TEST_PROJECT . id ,
92+ baselines : [
93+ {
94+ id : "some baseline id1" ,
95+ baselineName : "baseline1.png" ,
96+ testRunId : "testRunId1" ,
97+ testVariationId : "some test variation id" ,
98+ createdAt : "2020-09-14T06:57:25.845Z" ,
99+ updatedAt : "2020-09-14T06:57:25.845Z" ,
100+ testRun : testRunMock ,
101+ } ,
102+ {
103+ id : "some baseline id2" ,
104+ baselineName : "baseline2.png" ,
105+ testRunId : "testRunId2" ,
106+ testVariationId : "some test variation id" ,
107+ createdAt : "2020-09-12T06:57:25.845Z" ,
108+ updatedAt : "2020-09-12T06:57:25.845Z" ,
109+ testRun : testRunMock ,
110+ } ,
111+ ] ,
112+ } ;
113+
114+ export const TEST_BUILD_FAILED : Build = {
115+ id : "someId" ,
116+ number : 1 ,
117+ ciBuildId : "some build id" ,
118+ projectName : "Project name" ,
119+ branchName : "Branch name" ,
120+ status : BuildStatus . failed ,
121+ createdAt : "2020-09-14T06:57:25.845Z" ,
122+ createdBy : "2020-09-14T06:57:25.845Z" ,
123+ testRuns : [ ] ,
124+ unresolvedCount : 0 ,
125+ passedCount : 2 ,
126+ failedCount : 1 ,
127+ isRunning : false ,
128+ merge : false ,
129+ } ;
130+
131+ export const TEST_BUILD_PASSED : Build = {
132+ id : "someId2" ,
133+ number : 2 ,
134+ ciBuildId : "" ,
135+ projectName : "Project name" ,
136+ branchName : "Branch name" ,
137+ status : BuildStatus . passed ,
138+ createdAt : "2020-09-14T06:57:25.845Z" ,
139+ createdBy : "2020-09-14T06:57:25.845Z" ,
140+ testRuns : [ ] ,
141+ unresolvedCount : 0 ,
142+ passedCount : 2 ,
143+ failedCount : 0 ,
144+ isRunning : false ,
145+ merge : false ,
146+ } ;
147+
148+ export const TEST_BUILD_UNRESOLVED : Build = {
149+ id : "someId3" ,
150+ number : 3 ,
151+ ciBuildId : "" ,
152+ projectName : "Project name" ,
153+ branchName : "Branch name" ,
154+ status : BuildStatus . unresolved ,
155+ createdAt : "2020-09-14T06:57:25.845Z" ,
156+ createdBy : "2020-09-14T06:57:25.845Z" ,
157+ testRuns : [ ] ,
158+ unresolvedCount : 2 ,
159+ passedCount : 0 ,
160+ failedCount : 0 ,
161+ isRunning : false ,
162+ merge : true ,
163+ } ;
164+
165+ export const TEST_UNRESOLVED : TestRun = {
166+ id : "some test run id" ,
167+ buildId : "some build id" ,
168+ imageName : "image.png" ,
169+ diffName : "diff.png" ,
170+ baselineName : "baseline.png" ,
171+ diffPercent : 1.24 ,
172+ diffTollerancePercent : 3.21 ,
173+ status : TestStatus . unresolved ,
174+ testVariationId : "some test variation id" ,
175+ name : "test run name" ,
176+ os : "OS" ,
177+ browser : "browser" ,
178+ viewport : "viewport" ,
179+ device : "device" ,
180+ ignoreAreas : `[{"id":"1606901916571","x":232,"y":123,"width":166,"height":138}]` ,
181+ tempIgnoreAreas : `[{"x":100,"y":300,"width":600,"height":700}]` ,
182+ comment : "some comment" ,
183+ branchName : "branch name" ,
184+ baselineBranchName : "baselineBranchName" ,
185+ merge : false ,
186+ } ;
187+
188+ export const TEST_RUN_APPROVED : TestRun = {
189+ id : "some test run id2" ,
190+ buildId : "some build id" ,
191+ imageName : "imageName" ,
192+ diffName : "diffName" ,
193+ diffPercent : 1.24 ,
194+ diffTollerancePercent : 3.21 ,
195+ status : TestStatus . approved ,
196+ testVariationId : "some test variation id" ,
197+ name : "test run name2" ,
198+ baselineName : "baselineName" ,
199+ os : "OS" ,
200+ browser : "browser" ,
201+ viewport : "viewport" ,
202+ device : "device" ,
203+ ignoreAreas : "[]" ,
204+ tempIgnoreAreas : "[]" ,
205+ comment : "some comment" ,
206+ branchName : "branch name" ,
207+ baselineBranchName : "baselineBranchName" ,
208+ merge : false ,
209+ } ;
210+
211+ export const TEST_RUN_NEW : TestRun = {
212+ id : "some test run id3" ,
213+ buildId : "some build id" ,
214+ imageName : "imageName" ,
215+ diffName : "diffName" ,
216+ diffPercent : 1.24 ,
217+ diffTollerancePercent : 3.21 ,
218+ status : TestStatus . new ,
219+ testVariationId : "some test variation id" ,
220+ name : "test run name3" ,
221+ baselineName : "baselineName" ,
222+ os : "" ,
223+ browser : "" ,
224+ viewport : "" ,
225+ device : "" ,
226+ ignoreAreas : "[]" ,
227+ tempIgnoreAreas : "[]" ,
228+ comment : "some comment" ,
229+ branchName : "branch name" ,
230+ baselineBranchName : "baselineBranchName" ,
231+ merge : false ,
232+ } ;
233+
234+ export const TEST_RUN_OK : TestRun = {
235+ id : "some test run id4" ,
236+ buildId : "some build id" ,
237+ imageName : "imageName" ,
238+ diffName : "diffName" ,
239+ diffPercent : 1.24 ,
240+ diffTollerancePercent : 3.21 ,
241+ status : TestStatus . ok ,
242+ testVariationId : "some test variation id" ,
243+ name : "test run name4" ,
244+ baselineName : "baselineName" ,
245+ os : "" ,
246+ browser : "" ,
247+ viewport : "" ,
248+ device : "" ,
249+ ignoreAreas : "[]" ,
250+ tempIgnoreAreas : "[]" ,
251+ comment : "some comment" ,
252+ branchName : "branch name" ,
253+ baselineBranchName : "baselineBranchName" ,
254+ merge : false ,
255+ } ;
0 commit comments