@@ -8,8 +8,6 @@ import type { Channel } from 'stream-chat';
88import { useChannelDetailsContext } from '../../../contexts/channelDetailsContext/channelDetailsContext' ;
99import { ChatContext } from '../../../contexts/chatContext/ChatContext' ;
1010import { WithComponents } from '../../../contexts/componentsContext/ComponentsContext' ;
11- import type { OwnCapabilitiesContextValue } from '../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext' ;
12- import { useOwnCapabilitiesContext } from '../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext' ;
1311import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext' ;
1412import { defaultTheme } from '../../../contexts/themeContext/utils/theme' ;
1513import { TranslationProvider } from '../../../contexts/translationContext/TranslationContext' ;
@@ -136,44 +134,6 @@ describe('ChannelDetailsScreen', () => {
136134 expect ( captured ?. onChannelDismiss ) . toBe ( onChannelDismiss ) ;
137135 expect ( captured ?. onBack ) . toBe ( onBack ) ;
138136 } ) ;
139-
140- it ( 'exposes own capabilities derived from the channel via OwnCapabilitiesContext' , ( ) => {
141- const unsubscribe = jest . fn ( ) ;
142- const channelWithCapabilities = {
143- cid : 'messaging:test' ,
144- id : 'test' ,
145- data : { own_capabilities : [ 'send-message' , 'delete-own-message' ] } ,
146- on : jest . fn ( ( ) => ( { unsubscribe } ) ) ,
147- } as unknown as Channel ;
148-
149- let captured : OwnCapabilitiesContextValue | undefined ;
150- const CapabilitiesProbe = ( ) => {
151- captured = useOwnCapabilitiesContext ( ) ;
152- return null ;
153- } ;
154-
155- render (
156- < Providers >
157- < WithComponents
158- overrides = { {
159- ...SECTION_OVERRIDES ,
160- ChannelDetailsScreenContent : CapabilitiesProbe ,
161- } }
162- >
163- < ChannelDetailsScreen channel = { channelWithCapabilities } />
164- </ WithComponents >
165- </ Providers > ,
166- ) ;
167-
168- expect ( captured ) . toBeDefined ( ) ;
169- expect ( captured ?. sendMessage ) . toBe ( true ) ;
170- expect ( captured ?. deleteOwnMessage ) . toBe ( true ) ;
171- expect ( captured ?. banChannelMembers ) . toBe ( false ) ;
172- expect ( channelWithCapabilities . on ) . toHaveBeenCalledWith (
173- 'capabilities.changed' ,
174- expect . any ( Function ) ,
175- ) ;
176- } ) ;
177137 } ) ;
178138
179139 describe ( 'ChannelDetailsScreenContent override' , ( ) => {
0 commit comments