@@ -2440,33 +2440,6 @@ describe('afterFind hooks', () => {
2440
2440
expect ( pointer . get ( 'foo' ) ) . toBe ( 'bar' ) ;
2441
2441
} ) ;
2442
2442
2443
- it ( 'can set a pointer object in afterFind with User' , async ( ) => {
2444
- await Parse . User . signUp ( 'tupac' , 'shakur' ) ;
2445
- const obj = new Parse . Object ( 'MyObject' ) ;
2446
- obj . set ( 'xyz' , 'yolo' ) ;
2447
- await obj . save ( ) ;
2448
- Parse . Cloud . afterFind ( 'MyObject' , async ( { user, objects } ) => {
2449
- const otherObject = new Parse . Object ( 'Test' ) ;
2450
- otherObject . set ( 'foo' , 'bar' ) ;
2451
- otherObject . set ( 'user' , user ) ;
2452
- for ( const property in objects [ 0 ] . attributes ) {
2453
- if ( Object . prototype . hasOwnProperty . call ( objects [ 0 ] . attributes , property ) ) {
2454
- otherObject . set ( property , objects [ 0 ] . attributes [ property ] ) ;
2455
- }
2456
- }
2457
- await otherObject . save ( null , { useMasterKey : true } ) ;
2458
- const query = new Parse . Query ( 'Test' ) ;
2459
- query . equalTo ( 'foo' , 'bar' ) ;
2460
- const obj = await query . first ( ) ;
2461
- expect ( obj . get ( 'user' ) . id ) . toEqual ( user . id ) ;
2462
- expect ( obj . get ( 'xyz' ) ) . toBe ( 'yolo' ) ;
2463
- } ) ;
2464
- const query = new Parse . Query ( 'MyObject' ) ;
2465
- query . equalTo ( 'objectId' , obj . id ) ;
2466
- const obj2 = await query . first ( ) ;
2467
- expect ( obj2 . get ( 'xyz' ) ) . toBe ( 'yolo' ) ;
2468
- } ) ;
2469
-
2470
2443
it ( 'can set invalid object in afterFind' , async ( ) => {
2471
2444
const obj = new Parse . Object ( 'MyObject' ) ;
2472
2445
await obj . save ( ) ;
0 commit comments