@@ -277,8 +277,22 @@ describe('useFollowMutation', () => {
277277 pages : [
278278 {
279279 data : [
280- { username : 'targetUser' , displayName : 'Target User' , isFollowing : false } ,
281- { username : 'otherUser' , displayName : 'Other User' , isFollowing : true } ,
280+ {
281+ username : 'targetUser' ,
282+ displayName : 'Target User' ,
283+ bio : null ,
284+ avatarUrl : null ,
285+ bioEntities : null ,
286+ relationship : { ...rel , following : false } ,
287+ } ,
288+ {
289+ username : 'otherUser' ,
290+ displayName : 'Other User' ,
291+ bio : null ,
292+ avatarUrl : null ,
293+ bioEntities : null ,
294+ relationship : { ...rel , following : true } ,
295+ } ,
282296 ] ,
283297 nextCursor : undefined ,
284298 } ,
@@ -299,8 +313,8 @@ describe('useFollowMutation', () => {
299313 'tweetLikers' ,
300314 'tweet-123' ,
301315 ] ) as typeof likersData ;
302- expect ( updatedLikers . pages [ 0 ] . data [ 0 ] . isFollowing ) . toBe ( true ) ;
303- expect ( updatedLikers . pages [ 0 ] . data [ 1 ] . isFollowing ) . toBe ( true ) ; // unchanged
316+ expect ( updatedLikers . pages [ 0 ] . data [ 0 ] . relationship ?. following ) . toBe ( true ) ;
317+ expect ( updatedLikers . pages [ 0 ] . data [ 1 ] . relationship ?. following ) . toBe ( true ) ; // unchanged
304318 } ) ;
305319
306320 it ( 'updates tweetRetweeters cache when following a user' , async ( ) => {
@@ -322,8 +336,22 @@ describe('useFollowMutation', () => {
322336 pages : [
323337 {
324338 data : [
325- { username : 'retweeter' , displayName : 'Retweeter' , isFollowing : false } ,
326- { username : 'anotherUser' , displayName : 'Another' , isFollowing : false } ,
339+ {
340+ username : 'retweeter' ,
341+ displayName : 'Retweeter' ,
342+ bio : null ,
343+ avatarUrl : null ,
344+ bioEntities : null ,
345+ relationship : { ...rel , following : false } ,
346+ } ,
347+ {
348+ username : 'anotherUser' ,
349+ displayName : 'Another' ,
350+ bio : null ,
351+ avatarUrl : null ,
352+ bioEntities : null ,
353+ relationship : { ...rel , following : false } ,
354+ } ,
327355 ] ,
328356 nextCursor : undefined ,
329357 } ,
@@ -344,8 +372,8 @@ describe('useFollowMutation', () => {
344372 'tweetRetweeters' ,
345373 'tweet-456' ,
346374 ] ) as typeof retweetersData ;
347- expect ( updatedRetweeters . pages [ 0 ] . data [ 0 ] . isFollowing ) . toBe ( true ) ;
348- expect ( updatedRetweeters . pages [ 0 ] . data [ 1 ] . isFollowing ) . toBe ( false ) ;
375+ expect ( updatedRetweeters . pages [ 0 ] . data [ 0 ] . relationship ?. following ) . toBe ( true ) ;
376+ expect ( updatedRetweeters . pages [ 0 ] . data [ 1 ] . relationship ?. following ) . toBe ( false ) ;
349377 } ) ;
350378
351379 it ( 'creates default relationship when target profile has no relationship' , async ( ) => {
@@ -446,7 +474,16 @@ describe('useFollowMutation', () => {
446474 const likersData = {
447475 pages : [
448476 {
449- data : [ { username : 'targetUser' , displayName : 'Target' , isFollowing : false } ] ,
477+ data : [
478+ {
479+ username : 'targetUser' ,
480+ displayName : 'Target' ,
481+ bio : null ,
482+ avatarUrl : null ,
483+ bioEntities : null ,
484+ relationship : { ...rel , following : false } ,
485+ } ,
486+ ] ,
450487 nextCursor : undefined ,
451488 } ,
452489 ] ,
@@ -457,7 +494,16 @@ describe('useFollowMutation', () => {
457494 const retweetersData = {
458495 pages : [
459496 {
460- data : [ { username : 'targetUser' , displayName : 'Target' , isFollowing : false } ] ,
497+ data : [
498+ {
499+ username : 'targetUser' ,
500+ displayName : 'Target' ,
501+ bio : null ,
502+ avatarUrl : null ,
503+ bioEntities : null ,
504+ relationship : { ...rel , following : false } ,
505+ } ,
506+ ] ,
461507 nextCursor : undefined ,
462508 } ,
463509 ] ,
@@ -484,8 +530,8 @@ describe('useFollowMutation', () => {
484530 'tweet-789' ,
485531 ] ) as typeof retweetersData ;
486532
487- expect ( revertedLikers . pages [ 0 ] . data [ 0 ] . isFollowing ) . toBe ( false ) ;
488- expect ( revertedRetweeters . pages [ 0 ] . data [ 0 ] . isFollowing ) . toBe ( false ) ;
533+ expect ( revertedLikers . pages [ 0 ] . data [ 0 ] . relationship ?. following ) . toBe ( false ) ;
534+ expect ( revertedRetweeters . pages [ 0 ] . data [ 0 ] . relationship ?. following ) . toBe ( false ) ;
489535 } ) ;
490536
491537 it ( 'handles mutation without target profile in cache' , async ( ) => {
0 commit comments