File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2120,6 +2120,20 @@ describe('Parse.Object testing', () => {
21202120 await object . save ( ) ;
21212121 } ) ;
21222122
2123+ it ( 'should not change the json field to array in afterSave' , async ( ) => {
2124+ Parse . Cloud . beforeSave ( 'failingJSONTestCase' , req => {
2125+ expect ( req . object . get ( 'jsonField' ) ) . toEqual ( { '123' : 'test' } ) ;
2126+ } ) ;
2127+
2128+ Parse . Cloud . afterSave ( 'failingJSONTestCase' , req => {
2129+ expect ( req . object . get ( 'jsonField' ) ) . toEqual ( { '123' : 'test' } ) ;
2130+ } ) ;
2131+
2132+ const object = new Parse . Object ( 'failingJSONTestCase' ) ;
2133+ object . set ( 'jsonField' , { '123' : 'test' } ) ;
2134+ await object . save ( ) ;
2135+ } ) ;
2136+
21232137 it ( 'returns correct field values' , async ( ) => {
21242138 const values = [
21252139 { field : 'string' , value : 'string' } ,
You can’t perform that action at this time.
0 commit comments