File tree 1 file changed +14
-0
lines changed
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', () => {
2120
2120
await object . save ( ) ;
2121
2121
} ) ;
2122
2122
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
+
2123
2137
it ( 'returns correct field values' , async ( ) => {
2124
2138
const values = [
2125
2139
{ field : 'string' , value : 'string' } ,
You can’t perform that action at this time.
0 commit comments