@@ -3,22 +3,19 @@ import { useGetProfileAssetsQuery } from '../../../features/profile/profile.asse
33import { useGetProfileCreationsQuery } from '../../../features/profile/profile.creations.client'
44import { useGetProfilePlacesQuery } from '../../../features/profile/profile.places.client'
55import { useGetProfileCommunitiesQuery } from '../../../features/profile/profile.social.client'
6- import { useAuthIdentity } from '../../../hooks/useAuthIdentity'
76import { useReelImagesByUser } from '../../../hooks/useReelImagesByUser'
87import { useProfileTabAvailability } from './useProfileTabAvailability'
98
109jest . mock ( '../../../features/profile/profile.assets.client' , ( ) => ( { useGetProfileAssetsQuery : jest . fn ( ) } ) )
1110jest . mock ( '../../../features/profile/profile.creations.client' , ( ) => ( { useGetProfileCreationsQuery : jest . fn ( ) } ) )
1211jest . mock ( '../../../features/profile/profile.places.client' , ( ) => ( { useGetProfilePlacesQuery : jest . fn ( ) } ) )
1312jest . mock ( '../../../features/profile/profile.social.client' , ( ) => ( { useGetProfileCommunitiesQuery : jest . fn ( ) } ) )
14- jest . mock ( '../../../hooks/useAuthIdentity' , ( ) => ( { useAuthIdentity : jest . fn ( ) } ) )
1513jest . mock ( '../../../hooks/useReelImagesByUser' , ( ) => ( { useReelImagesByUser : jest . fn ( ) } ) )
1614
1715const mockedUsePlaces = useGetProfilePlacesQuery as jest . MockedFunction < typeof useGetProfilePlacesQuery >
1816const mockedUseCreations = useGetProfileCreationsQuery as jest . MockedFunction < typeof useGetProfileCreationsQuery >
1917const mockedUseAssets = useGetProfileAssetsQuery as jest . MockedFunction < typeof useGetProfileAssetsQuery >
2018const mockedUseCommunities = useGetProfileCommunitiesQuery as jest . MockedFunction < typeof useGetProfileCommunitiesQuery >
21- const mockedUseAuthIdentity = useAuthIdentity as jest . MockedFunction < typeof useAuthIdentity >
2219const mockedUseReelImages = useReelImagesByUser as jest . MockedFunction < typeof useReelImagesByUser >
2320
2421const ADDRESS = '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
@@ -28,7 +25,6 @@ const emptyPhotosResult = { images: [], total: 0, isLoading: false, error: null
2825
2926describe ( 'useProfileTabAvailability' , ( ) => {
3027 beforeEach ( ( ) => {
31- mockedUseAuthIdentity . mockReturnValue ( { identity : undefined } as unknown as ReturnType < typeof useAuthIdentity > )
3228 mockedUsePlaces . mockReturnValue ( emptyQueryResult as unknown as ReturnType < typeof useGetProfilePlacesQuery > )
3329 mockedUseCreations . mockReturnValue ( emptyQueryResult as unknown as ReturnType < typeof useGetProfileCreationsQuery > )
3430 mockedUseAssets . mockReturnValue ( emptyQueryResult as unknown as ReturnType < typeof useGetProfileAssetsQuery > )
@@ -116,5 +112,11 @@ describe('useProfileTabAvailability', () => {
116112
117113 expect ( result . current . hidden . size ) . toBe ( 0 )
118114 } )
115+
116+ it ( 'should probe photos unsigned so private snapshots never reveal the tab' , ( ) => {
117+ renderHook ( ( ) => useProfileTabAvailability ( ADDRESS , true ) )
118+
119+ expect ( mockedUseReelImages ) . toHaveBeenCalledWith ( ADDRESS , { limit : 1 , offset : 0 } )
120+ } )
119121 } )
120122} )
0 commit comments