import { TestBed , ComponentFixture } from '@angular/core/testing' ; import { AppTestingModule } from '../../../testing/app-testing.module' ; import { LogoutComponent } from './logout.component' ; import { Store } from '@ngrx/store' ; import { SetSelectedNodesAction } from '@alfresco/aca-shared/store' ; describe ( 'LogoutComponent' , ( ) => { let fixture ; let component ; let store ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { imports : [ AppTestingModule ] , declarations : [ LogoutComponent ] , providers : [ { provide : Store , useValue : { dispatch : jasmine . createSpy ( 'dispatch' ) } } ] } ) ; store = TestBed . inject ( Store ) ; fixture = TestBed . createComponent ( LogoutComponent ) ; component = fixture . componentInstance ; fixture . detectChanges ( ) ; } ) ; it ( 'should reset selected nodes from store' , ( ) => { component . onLogoutEvent ( ) ; expect ( store . dispatch ) . toHaveBeenCalledWith ( new SetSelectedNodesAction ( [ ] ) ) ; } ) ; } ) ;