@@ -3091,6 +3091,35 @@ describe('Testing Crashes', function() {
30913091 } ) ;
30923092 } ) ;
30933093
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+
30943123 describe ( 'Reset app' , function ( ) {
30953124 it ( 'should reset data' , function ( done ) {
30963125 var params = { app_id : APP_ID , period : "reset" } ;
@@ -3144,4 +3173,4 @@ describe('Testing Crashes', function() {
31443173 } ) ;
31453174 } ) ;
31463175 } ) ;
3147- } ) ;
3176+ } ) ;
0 commit comments