11import { HttpClient } from '@angular/common/http' ;
22import { FeatureManagerService } from 'src/app/modules/shared/feature-toggles/feature-toggle-manager.service' ;
3+ < < < << << HEAD
34import { waitForAsync , ComponentFixture , TestBed , inject } from '@angular / core / testing ';
5+ === === =
6+ import { waitForAsync , ComponentFixture , TestBed } from '@angular/core/testing' ;
7+ >>> >>> > feat : TT - 190 mock test
48import { MockStore , provideMockStore } from '@ngrx/store/testing' ;
59import { NgxPaginationModule } from 'ngx-pagination' ;
610import { UsersListComponent } from './users-list.component' ;
@@ -16,20 +20,27 @@ import {
1620import { ActionsSubject } from '@ngrx/store' ;
1721import { DataTablesModule } from 'angular-datatables' ;
1822import { of } from 'rxjs' ;
23+ << << << < HEAD
1924import { FeatureToggleProvider } from 'src/app/modules/shared/feature-toggles/feature-toggle-provider.service' ;
2025import { AppConfigurationClient } from '@azure/app-configuration' ;
2126import { FeatureFilterProvider } from '../../../shared/feature-toggles/filters/feature-filter-provider.service' ;
2227import { AzureAdB2CService } from '../../../login/services/azure.ad.b2c.service' ;
2328import { FeatureToggleModel } from 'src/app/modules/shared/feature-toggles/feature-toggle.model' ;
29+ === === =
30+ >>> >>> > feat : TT - 190 mock test
2431
2532describe ( 'UsersListComponent' , ( ) => {
2633 let component : UsersListComponent ;
2734 let fixture : ComponentFixture < UsersListComponent > ;
2835 let store : MockStore < UserState > ;
2936 const actionSub : ActionsSubject = new ActionsSubject ( ) ;
37+ < < < << << HEAD
3038 const fakeAppConfigurationConnectionString = 'Endpoint=http://fake.foo;Id=fake.id;Secret=fake.secret' ;
3139 let service : FeatureManagerService ;
3240 let fakeFeatureToggleProvider ;
41+ = === ===
42+ let featureManagerService : FeatureManagerService ;
43+ > >>> >>> feat: TT - 190 mock test
3344
3445 const state : UserState = {
3546 data : [
@@ -64,6 +75,7 @@ describe('UsersListComponent', () => {
6475 { provide : ActionsSubject , useValue : actionSub } ,
6576 { provide : FeatureManagerService , useValue : service } ] ,
6677 } ) . compileComponents ( ) ;
78+ featureManagerService = TestBed . inject ( FeatureManagerService ) ;
6779 } )
6880 ) ;
6981
@@ -260,8 +272,21 @@ describe('UsersListComponent', () => {
260272 expect ( component . dtElement . dtInstance . then ) . toHaveBeenCalled ( ) ;
261273 } ) ;
262274
275+ < < < << << HEAD
263276 fit ( 'When Component is created, should call the feature toggle method' , ( ) => {
264277 spyOn ( component , 'isFeatureToggleActivated' ) . and . returnValue ( of ( true ) ) ;
278+ === = ===
279+
280+ fit ( 'When Component is created, should call the feature toggle method' , ( ) => {
281+
282+ // spyOn(service, 'getAll').and.callFake( () => {
283+ // return of(mockUser);
284+ // });
285+
286+ spyOn ( component , 'isFeatureToggleActivated' ) . and . callFake ( ( ) => {
287+ return of ( true ) ;
288+ } ) ;
289+ > >>> >>> feat: TT - 190 mock test
265290
266291 component . ngOnInit ( ) ;
267292
@@ -274,4 +299,5 @@ describe('UsersListComponent', () => {
274299 component . loadUsersSubscription . unsubscribe ( ) ;
275300 fixture . destroy ( ) ;
276301 } ) ;
302+
277303} ) ;
0 commit comments