@@ -23,7 +23,7 @@ import {MatDialog, MatDialogModule} from '@angular/material/dialog';
2323import { MatSnackBar } from '@angular/material/snack-bar' ;
2424import { By } from '@angular/platform-browser' ;
2525import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
26- import { ActivatedRoute , NavigationEnd , Params , Router , UrlTree } from '@angular/router' ;
26+ import { ActivatedRoute , NavigationEnd , Router , UrlTree } from '@angular/router' ;
2727// 1p-ONLY-IMPORTS: import {beforeEach, describe, expect, it}
2828import { BehaviorSubject , NEVER , of , ReplaySubject , Subject , throwError } from 'rxjs' ;
2929
@@ -190,12 +190,11 @@ describe('ChatComponent', () => {
190190 mockAgentBuilderService = jasmine . createSpyObj (
191191 'AgentBuilderService' , [ 'clear' , 'setLoadedAgentData' ] ) ;
192192
193- const queryParamsSubject = new BehaviorSubject < Params > ( { } ) ;
194193 mockActivatedRoute = {
195194 snapshot : {
196195 queryParams : { } ,
197196 } as any ,
198- queryParams : queryParamsSubject ,
197+ queryParams : of ( { } ) ,
199198 } ;
200199
201200 const appName = new BehaviorSubject < string > ( TEST_APP_1_NAME ) ;
@@ -321,9 +320,9 @@ describe('ChatComponent', () => {
321320 mockAgentService . listAppsResponse . next (
322321 [ TEST_APP_1_NAME , TEST_APP_2_NAME ] ) ;
323322
324- const params = { [ APP_QUERY_PARAM ] : INVALID_APP_NAME } ;
325- mockActivatedRoute . snapshot ! . queryParams = params ;
326- ( mockActivatedRoute . queryParams as Subject < Params > ) . next ( params ) ;
323+ mockActivatedRoute . snapshot ! . queryParams = {
324+ [ APP_QUERY_PARAM ] : INVALID_APP_NAME ,
325+ } ;
327326 mockAgentService . listAppsResponse . next ( [ TEST_APP_1_NAME ] ) ;
328327 fixture = TestBed . createComponent ( ChatComponent ) ;
329328 component = fixture . componentInstance ;
@@ -402,11 +401,9 @@ describe('ChatComponent', () => {
402401 mockAgentService . listAppsResponse . next (
403402 [ TEST_APP_1_NAME , TEST_APP_2_NAME ] ) ;
404403
405- const params = {
404+ mockActivatedRoute . snapshot ! . queryParams = {
406405 [ APP_QUERY_PARAM ] : TEST_APP_2_NAME ,
407406 } ;
408- mockActivatedRoute . snapshot ! . queryParams = params ;
409- ( mockActivatedRoute . queryParams as Subject < Params > ) . next ( params ) ;
410407 component . ngOnInit ( ) ;
411408 } ) ;
412409 it ( 'should create new session on init' , ( ) => {
@@ -423,12 +420,10 @@ describe('ChatComponent', () => {
423420 beforeEach ( ( ) => {
424421 mockAgentService . listAppsResponse . next ( [ TEST_APP_1_NAME ] ) ;
425422 mockFeatureFlagService . isSessionUrlEnabledResponse . next ( true ) ;
426- const params = {
423+ mockActivatedRoute . snapshot ! . queryParams = {
427424 [ APP_QUERY_PARAM ] : TEST_APP_1_NAME ,
428425 [ SESSION_QUERY_PARAM ] : SESSION_2_ID ,
429426 } ;
430- mockActivatedRoute . snapshot ! . queryParams = params ;
431- ( mockActivatedRoute . queryParams as Subject < Params > ) . next ( params ) ;
432427 mockSessionService . getSessionResponse . next (
433428 { id : SESSION_2_ID , state : { } , events : [ ] } ) ;
434429 } ) ;
@@ -476,12 +471,10 @@ describe('ChatComponent', () => {
476471
477472 describe ( 'when session in URL is not found' , ( ) => {
478473 beforeEach ( async ( ) => {
479- const params = {
474+ mockActivatedRoute . snapshot ! . queryParams = {
480475 [ APP_QUERY_PARAM ] : TEST_APP_1_NAME ,
481476 [ SESSION_QUERY_PARAM ] : SESSION_2_ID ,
482477 } ;
483- mockActivatedRoute . snapshot ! . queryParams = params ;
484- ( mockActivatedRoute . queryParams as Subject < Params > ) . next ( params ) ;
485478 mockSessionService . getSession . and . callFake (
486479 ( userId : string , app : string , sessionId : string ) => {
487480 if ( sessionId === SESSION_2_ID ) {
0 commit comments