· 6 years ago · Aug 21, 2019, 11:30 PM
1% npm run test-integration-docker
2
3> bitmoji-api@1.0.0 test-integration-docker /Users/stuart.matheson/Snapchat/Dev/monorepo/bitmoji_api
4> docker-compose exec app npm run test-integration -- --server localhost:9089
5
6
7> bitmoji-api@1.0.0 test-integration /usr/src/app
8> mocha ./integration-tests/* -t 40000 "--server" "localhost:9089"
9
10
11
12 POST /analytics/wevents
13 ✓ responds with success true given batch of events (151ms)
14 ✓ responds with success false if payload fails validation (159ms)
15 ✓ responds with success true and error if all events are ignored (155ms)
16 ✓ Avatar builder v3 events batch (also used in 2.1) (157ms)
17 ✓ Avatar builder v3 events individual (also used in 2.1) (753ms)
18
19 POST /analytics/wevent
20 ✓ responds with success true given an event (151ms)
21 ✓ responds with success false if payload fails validation (151ms)
22 ✓ responds with success true and error if event is ignored (156ms)
23 ✓ Avatar builder v3 event (also used in 2.1) (156ms)
24 ✓ Avatar builder v3 event individual (also used in 2.1) (748ms)
25
26 /GET Assets v2
27 ✓ No duplicate entries (255ms)
28
29 /POST change-style
30 ✓ Change style without token returns 400 (148ms)
31 ✓ Change style with bad token returns 401 (181ms)
32 1) Change style without specifying style returns 400
33 2) Change style with invalid style returns 400
34 Male Bitmoji User
35 3) "before each" hook for "Change style to bitstrips and back"
36 Female Bitstrips User
37 4) "before each" hook for "Change style to bitmoji and back"
38
39 /GET delta
40 ✓ Get delta with full query male (157ms)
41 ✓ Get delta with full query female (155ms)
42 ✓ Get delta with male style 4, face proportion 1 (156ms)
43
44 /GET Avatar preview
45 ✓ Dumb render test (268ms)
46
47 /GET universal-avatar
48 5) Simply get test
49 6) Get with bad style returns a 400
50
51 /POST universal-avatar
52 7) Update Bitmoji User
53 8) Update Female Bitstrips User
54 9) changes style
55 10) changes style and gender
56 11) changes gender but not style
57 Create male Bitmoji User
58 12) "before each" hook for "New User"
59
60 /GET Assets v3
61 ✓ No duplicate entries (193ms)
62 ✓ Option id defaults available (175ms)
63
64 /POST change-style (builder v3)
65 13) change-style with no avatar returns 400
66 Male Bitstrips User
67 14) "before each" hook for "Change style to CM and back"
68 Female Bitstrips User
69 15) "before each" hook for "Change style to CM and back"
70
71 /GET avatar (builder v3)
72 16) Get avatar
73 17) Get empty avatar
74
75 /GET avatar-info (builder v3)
76 18) Get avatar info
77 19) Get empty avatar info
78
79 /POST option-id-mapper (builder v3)
80 create
81 20) Returns the gender of the bitstrips avatar even though the current avatar is bitmoji
82 21) Saved bitmoji female returns the correct gender when mapped
83
84 /GET preview (builder v3)
85 ✓ Basic render works (213ms)
86
87 /POST avatar (builder v3)
88 create
89 22) Create new male bitstrips user
90 23) Create new female bitmoji user
91 24) Create new female cm user
92 25) Create new female cm user with bitstrips data errors
93 26) Create new female bitstrips user with bitstrips data errors
94 27) Create already created returns a 400
95 28) Create new male cm user with hair treatment
96 edit
97 29) Edit with no avatar returns 400
98 Editing mouth and lipstick
99 30) "before each" hook for "Should be able to change lipstick"
100 Create and edit male bitstrips
101 31) "before each" hook for "Edit avatar"
102 reset
103 32) Reset with no avatar returns 400
104 33) reset male bitstrips user to female bitstrips
105 34) reset female bitmoji user to female cm
106 35) reset male cm user to female bitmoji
107 36) reset male cm user to male cm
108 edit special cases
109 37) "before each" hook for "Edit bitstrips user without sending face proportion does not change the mod"
110
111 /POST create-avatar-data
112 ✓ Return notFound for non existing user (165ms)
113 ✓ Return badRequest for user with avatar id (1322ms)
114 ✓ Return badRequest if input is not deserializable (177ms)
115 ✓ Return badRequest if avatar data is undefined (159ms)
116 ✓ Return badRequest if avatar data gender is undefined (174ms)
117 ✓ Return badRequest if avatar data style is undefined (163ms)
118 ✓ Return badRequest if tou version is undefined (162ms)
119 ✓ Create avatar data (691ms)
120 ✓ Create avatar data: split outfit with custom colours (675ms)
121 ✓ Return badRequest for avatar data with split outfit and undefined custom colours (167ms)
122 ✓ Return badRequest for avatar data with split outfit and undefined split outfit categories (134ms)
123
124 /POST get-avatar-data
125 ✓ Return notFound for non existing user (148ms)
126 ✓ Return notModified for avatar that has not changed (161ms)
127 ✓ Return notFound for user without avatar id (309ms)
128 ✓ Return avatar data (175ms)
129
130 /POST update-avatar-data
131 ✓ Return notFound for non existing user (153ms)
132 ✓ Return notFound for user without avatar id (307ms)
133 ✓ Return badRequest for input that is not deserializable (162ms)
134 ✓ Return badRequest for avatar data with undefined gender (360ms)
135 ✓ Return badRequest for avatar data with undefined style (334ms)
136 ✓ Update avatar data (598ms)
137 ✓ Update avatar data: split outfit with custom colours (586ms)
138 ✓ Update avatar data: split outfit then update back to "regular" outfit without clothing_type (1320ms)
139 ✓ Return badRequest for avatar data with split outfit and undefined custom colours (340ms)
140 ✓ Return badRequest for avatar data with split outfit and undefined split outfit categories (351ms)
141 ✓ Update avatar data: split outfit with more custom colours, then less custom colours - removes old redundant colours (1251ms)
142
143 /content/stickers
144 POST
145 - returns 400 if missing token
146 - returns 200 if has valid bsauth token
147 - returns 200 without avatar with no_avatar
148 - compares etag depending on user locale
149
150 /content/templates
151 - includes the "outfits" property
152 - includes the "announcers" property
153 - includes the "tag_tiles" property
154 - includes the correct data in "fashion_announcer"
155 - only includes v5 tags
156 - includes all v5 tags at least once
157 - includes an "experiments" property
158 - includes "search_terms" property
159 - returns an etag
160 - returns 200 and new etag if etag does not match
161 - returns a different etag depending on user locale
162 - returns no error even if neither bitmoji-sc-token nor bitmoji-token is present in headers
163 - returns no error if experiment param is provided
164 - returns no error if chillvibes experiment group is default
165
166 /POST Accept developer terms
167 38) returns a 200 when accepting the terms
168 ✓ returns a 401 without a valid token (149ms)
169
170 /GET Avatar endpoint
171 Avatar data
172 39) includes styled_char_data for Bitstrips style for new sign-ups
173 40) includes styled_char_data for Bitmoji style for new sign-ups
174 41) includes styled_char_data for CM style for new sign-ups
175 42) includes styled_char_data for Bitstrips, Bitmoji, and CM style for new sign-ups
176 43) returns the fields in the expected types
177 Etags
178 44) returns 304 if the current avatar version matches the etag
179 45) returns 304 if the current avatar version matches the quoted etag
180
181 /GET Avatar endpoint V2
182 Avatar data
183 46) includes styled_char_data for Bitstrips style for new sign-ups
184 47) includes styled_char_data for Bitmoji style for new sign-ups
185 48) includes styled_char_data for CM style for new sign-ups
186 49) includes styled_char_data for Bitstrips, Bitmoji, and CM style for new sign-ups
187 50) returns the fields in the expected types
188 Etags
189 51) returns 304 if the current avatar version matches the etag
190
191 /POST Avatar endpoint
192 Saving avatar data
193 52) can update avatar character data for Bitstrips style
194 53) create avatar from default and modify avatar
195 54) create avatar and change face proportions
196 55) create avatar and change face proportions AND outfit
197 - can update avatar character data for Bitmoji style
198 56) can update avatar character data for CM style
199 57) does not update avatar version if no changes made
200 58) allows the user to update her/his avatar from Bitstrips style to Bitmoji style and vice-versa
201 59) allows the user to update her/his outfit
202 60) allows the user to update a hat and changing the outfit keeps the hat
203 61) create and update female bitmoji user
204 62) is able to restore to default face proportions in Bitstrips style
205 New avatars can only be created using default avatar_ids as source
206 63) should work with legacy female
207 64) should work with legacy male
208 65) should work with current female
209 66) should work with current male
210 67) should return 400 with anything else
211
212 Avatar management with Snapchat token
213 - Skipping: Snapchat integration tests without mocked server
214
215 POST /user
216 ✓ Create a new account -> login -> logout -> login (856ms)
217 ✓ Create a new account with birthday -> login -> logout -> login (866ms)
218 ✓ Do not allow to create account if it already exists (465ms)
219 ✓ Create a new account with uppercase email -> login with lowercase email (471ms)
220 ✓ Create a new account with uppercase email -> login with uppercase email (464ms)
221 ✓ Do not allow to create account with birthday it already exists (453ms)
222
223 /GET /user/data
224 Terms of service
225 68) migrates a bsauth user to the bitmoji_terms table when requesting data if signed up after latests ToU
226 With touVersion
227 69) also accept the latest terms for a bsauth user
228
229 DELETE /user
230 delete user without avatar
231 70) Create a new account without avatar -> login -> delete -> sign up with same credentials
232 delete user with avatar
233 71) Create a new account with avatar -> delete -> sign up with same credentials -> login -> get avatar
234
235 /user/link-bsauth
236 - Skipping: Snapchat integration tests without mocked server
237
238 POST /user/login
239 ✓ returns 200 for successful logout and deletes access token from the database (472ms)
240 ✓ Login with incorrect password does not return token and returns a 400 (469ms)
241 ✓ Login with incorrect email does not return token and returns a 400 (160ms)
242
243 POST /user/logout
244 72) returns 200 for successful logout and deletes access token from the database
245 ✓ returns 400 if no token supplied (149ms)
246 ✓ returns 200 if token not found in the database (152ms)
247
248 /mirror/image-upload
249 - Skipping: Snapchat integration tests without mocked server
250
251 /mirror/image-upload-universal
252 - Skipping: Snapchat integration tests without mocked server
253
254 POST /user
255 ✓ Create a new account, reset password with no captcha response (612ms)
256 ✓ Create a new account, reset password with invalid captcha response (686ms)
257 ✓ Create a new account, reset password, then update password (940ms)
258
259 /snapchat/content_v2
260 - snapchat en cron request returns no error
261 - snapchat geo cron request returns no error
262 - snapchat search cron request returns no error
263
264 /snapchat/server-unlink-user
265 - Skipping: Snapchat integration tests without mocked server
266
267 Weblogin delete webloginId
268 73) is able to delete a weblogin id
269
270 Weblogin get packs
271 74) is able to fetch packs and update last_accessed field
272
273 Weblogin registration and management
274 75) is able to add new weblogins and fetch them
275
276
277 61 passing (1m)
278 27 pending
279 75 failing