Skip to content

Commit de0aaf8

Browse files
scastillo-jpLEON12699
authored andcommitted
feat: TT-190 mock test
1 parent ed22b41 commit de0aaf8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/app/modules/users/components/users-list/users-list.component.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { HttpClient } from '@angular/common/http';
22
import { FeatureManagerService } from 'src/app/modules/shared/feature-toggles/feature-toggle-manager.service';
3+
<<<<<<< HEAD
34
import { waitForAsync, ComponentFixture, TestBed, inject } from '@angular/core/testing';
5+
=======
6+
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
7+
>>>>>>> feat: TT-190 mock test
48
import { MockStore, provideMockStore } from '@ngrx/store/testing';
59
import { NgxPaginationModule } from 'ngx-pagination';
610
import { UsersListComponent } from './users-list.component';
@@ -16,20 +20,27 @@ import {
1620
import { ActionsSubject } from '@ngrx/store';
1721
import { DataTablesModule } from 'angular-datatables';
1822
import { of } from 'rxjs';
23+
<<<<<<< HEAD
1924
import { FeatureToggleProvider } from 'src/app/modules/shared/feature-toggles/feature-toggle-provider.service';
2025
import { AppConfigurationClient } from '@azure/app-configuration';
2126
import { FeatureFilterProvider } from '../../../shared/feature-toggles/filters/feature-filter-provider.service';
2227
import { AzureAdB2CService } from '../../../login/services/azure.ad.b2c.service';
2328
import { FeatureToggleModel } from 'src/app/modules/shared/feature-toggles/feature-toggle.model';
29+
=======
30+
>>>>>>> feat: TT-190 mock test
2431

2532
describe('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

Comments
 (0)