@@ -45,32 +45,8 @@ describe("Populate mock data", async () => {
4545 }
4646 } , 60 * 1000 ) ;
4747
48- test ( "Create user avatars" , async ( ) => {
49- expect ( tokens . length ) . toBeTruthy ( ) ;
50-
51- for ( let token of tokens ) {
52- const client = new Client ( `${ name } -${ version } ` , process . env . VITEST_SERVICE_API_URL , token ) ;
53-
54- const response = await fetch ( "https://staging.avatar-service.ridetracker.app/api/avatars/render/random" , {
55- method : "GET" ,
56- headers : {
57- Accept : "application/json" ,
58- Authorization : `Bearer ${ client . token } `
59- }
60- } ) ;
61-
62- const result = await response . json ( ) as any ;
63- expect ( result . success ) . toBe ( true ) ;
64-
65- const userAvatarResult = await uploadUserAvatar ( client , result . base64Image , "{}" ) ;
66- expect ( userAvatarResult . success ) . toBe ( true ) ;
67-
68- userAvatars . push ( userAvatarResult . userAvatar . id ) ;
69- }
70- } , 60 * 1000 ) ;
71-
7248 test ( "Create activities" , async ( ) => {
73- expect ( userAvatars . length ) . toBeTruthy ( ) ;
49+ expect ( tokens . length ) . toBeTruthy ( ) ;
7450
7551 for ( let index = 0 ; index < 10 ; index ++ ) {
7652 const token = tokens [ Math . floor ( Math . random ( ) * tokens . length ) ] ;
@@ -119,4 +95,28 @@ describe("Populate mock data", async () => {
11995 expect ( activityCommentResult . success ) . toBe ( true ) ;
12096 }
12197 } , 60 * 1000 ) ;
98+
99+ test ( "Create user avatars" , async ( ) => {
100+ expect ( tokens . length ) . toBeTruthy ( ) ;
101+
102+ for ( let token of tokens ) {
103+ const client = new Client ( `${ name } -${ version } ` , process . env . VITEST_SERVICE_API_URL , token ) ;
104+
105+ const response = await fetch ( "https://staging.avatar-service.ridetracker.app/api/avatars/render/random" , {
106+ method : "GET" ,
107+ headers : {
108+ Accept : "application/json" ,
109+ Authorization : `Bearer ${ client . token } `
110+ }
111+ } ) ;
112+
113+ const result = await response . json ( ) as any ;
114+ expect ( result . success ) . toBe ( true ) ;
115+
116+ const userAvatarResult = await uploadUserAvatar ( client , result . base64Image , "{}" ) ;
117+ expect ( userAvatarResult . success ) . toBe ( true ) ;
118+
119+ userAvatars . push ( userAvatarResult . userAvatar . id ) ;
120+ }
121+ } , 60 * 1000 ) ;
122122} ) ;
0 commit comments