@@ -3091,6 +3091,35 @@ describe('Testing Crashes', function() {
3091
3091
} ) ;
3092
3092
} ) ;
3093
3093
3094
+ describe ( 'Crash app version' , async ( ) => {
3095
+ it ( 'should process crash app version as string' , async ( ) => {
3096
+ const crashData = {
3097
+ "_error" : "error" ,
3098
+ "_app_version" : 123 , // app version is number
3099
+ "_os" : "android" ,
3100
+ } ;
3101
+
3102
+ await request . get ( '/i' )
3103
+ . query ( { app_key : APP_KEY , device_id : DEVICE_ID , crash : JSON . stringify ( crashData ) } )
3104
+ . expect ( 200 ) ;
3105
+
3106
+ const crashGroupQuery = JSON . stringify ( {
3107
+ latest_version : { $in : [ `${ crashData . _app_version } ` ] } ,
3108
+ } ) ;
3109
+ let crashGroupResponse = await request
3110
+ . get ( '/o' )
3111
+ . query ( { method : 'crashes' , api_key : API_KEY_ADMIN , app_id : APP_ID , query : crashGroupQuery } ) ;
3112
+ const crashGroup = crashGroupResponse . body . aaData [ 0 ] ;
3113
+ crashGroupResponse = await request
3114
+ . get ( `/o?` )
3115
+ . query ( { method : 'crashes' , api_key : API_KEY_ADMIN , app_id : APP_ID , group : crashGroup . _id } ) ;
3116
+
3117
+ const crash = crashGroupResponse . body . data [ 0 ] ;
3118
+
3119
+ crash . app_version . should . equal ( `${ crashData . _app_version } ` ) ;
3120
+ } ) ;
3121
+ } ) ;
3122
+
3094
3123
describe ( 'Reset app' , function ( ) {
3095
3124
it ( 'should reset data' , function ( done ) {
3096
3125
var params = { app_id : APP_ID , period : "reset" } ;
@@ -3144,4 +3173,4 @@ describe('Testing Crashes', function() {
3144
3173
} ) ;
3145
3174
} ) ;
3146
3175
} ) ;
3147
- } ) ;
3176
+ } ) ;
0 commit comments