import { NO_ERRORS_SCHEMA } from '@angular/core' ; import { async , ComponentFixture , TestBed } from '@angular/core/testing' ; import { By } from '@angular/platform-browser' ; import { click , StoreStub } from '@nx-mean-starter/testing' ; import { UsersComponent } from './users.component' ; describe ( 'UsersComponent' , ( ) => { let component ; let fixture ; beforeEach ( async ( ( ) => { TestBed . configureTestingModule ( { declarations : [ UsersComponent ] , providers : [ StoreStub . provider ] , schemas : [ NO_ERRORS_SCHEMA ] , } ) . compileComponents ( ) ; } ) ) ; beforeEach ( ( ) => { fixture = TestBed . createComponent ( UsersComponent ) ; component = fixture . componentInstance ; fixture . detectChanges ( ) ; } ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ; it ( 'should get users' , ( ) => { const de = fixture . debugElement . query ( By . css ( 'button' ) ) ; click ( de ) ; component . users$ . subscribe ( val => expect ( val ) . toEqual ( [ ] ) ) ; } ) ; } ) ;