@@ -138,99 +138,6 @@ describe('ConnectionsManagerService', () => {
138138 expect ( launchSpy ) . toBeCalledTimes ( 1 )
139139 } )
140140
141- it ( 'emits the authoritative QSS URL for the NSE on iOS' , async ( ) => {
142- const originalPlatform = process . platform
143- Object . defineProperty ( process , 'platform' , {
144- value : 'ios' ,
145- } )
146-
147- try {
148- await localDbService . setCommunity ( {
149- ...community ,
150- teamId : 'team-id' ,
151- qssEndpoint : 'wss://community.example/ws' ,
152- } )
153- await localDbService . setCurrentCommunityId ( community . id )
154-
155- qssService . _qssEndpoint = 'wss://authoritative.example'
156-
157- const emitSpy = jest . spyOn ( connectionsManagerService . serverIoProvider . io , 'emit' )
158-
159- await ( connectionsManagerService as any ) . emitNseQssUrl ( )
160-
161- expect ( emitSpy ) . toHaveBeenCalledWith ( SocketEvents . NSE_QSS_URL_UPDATED , {
162- teamId : 'team-id' ,
163- qssUrl : 'https://authoritative.example' ,
164- } )
165- } finally {
166- Object . defineProperty ( process , 'platform' , {
167- value : originalPlatform ,
168- } )
169- }
170- } )
171-
172- it ( 'falls back to the stored community QSS endpoint when no authoritative endpoint is available' , async ( ) => {
173- const originalPlatform = process . platform
174- Object . defineProperty ( process , 'platform' , {
175- value : 'ios' ,
176- } )
177-
178- try {
179- await localDbService . setCommunity ( {
180- ...community ,
181- teamId : 'team-id' ,
182- qssEndpoint : 'ws://community.example/ws' ,
183- } )
184- await localDbService . setCurrentCommunityId ( community . id )
185-
186- qssService . _qssEndpoint = undefined as any
187-
188- const emitSpy = jest . spyOn ( connectionsManagerService . serverIoProvider . io , 'emit' )
189-
190- await ( connectionsManagerService as any ) . emitNseQssUrl ( )
191-
192- expect ( emitSpy ) . toHaveBeenCalledWith ( SocketEvents . NSE_QSS_URL_UPDATED , {
193- teamId : 'team-id' ,
194- qssUrl : 'http://community.example/ws' ,
195- } )
196- } finally {
197- Object . defineProperty ( process , 'platform' , {
198- value : originalPlatform ,
199- } )
200- }
201- } )
202-
203- it ( 'skips NSE QSS URL emission when no valid ws or wss endpoint can be derived' , async ( ) => {
204- const originalPlatform = process . platform
205- Object . defineProperty ( process , 'platform' , {
206- value : 'ios' ,
207- } )
208-
209- try {
210- await localDbService . setCommunity ( {
211- ...community ,
212- teamId : 'team-id' ,
213- qssEndpoint : 'https://community.example/api' ,
214- } )
215- await localDbService . setCurrentCommunityId ( community . id )
216-
217- qssService . _qssEndpoint = 'https://authoritative.example/api'
218-
219- const emitSpy = jest . spyOn ( connectionsManagerService . serverIoProvider . io , 'emit' )
220-
221- await ( connectionsManagerService as any ) . emitNseQssUrl ( )
222-
223- expect ( emitSpy ) . not . toHaveBeenCalledWith (
224- SocketEvents . NSE_QSS_URL_UPDATED ,
225- expect . objectContaining ( { teamId : 'team-id' } )
226- )
227- } finally {
228- Object . defineProperty ( process , 'platform' , {
229- value : originalPlatform ,
230- } )
231- }
232- } )
233-
234141 it ( 'pauses and resumes qss alongside the mobile lifecycle' , async ( ) => {
235142 const closeSocketSpy = jest . spyOn ( connectionsManagerService , 'closeSocket' ) . mockResolvedValue ( )
236143 const openSocketSpy = jest . spyOn ( connectionsManagerService , 'openSocket' ) . mockResolvedValue ( )
0 commit comments