2424
2525import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2626import { Router } from '@angular/router' ;
27- import { AppConfigService , UnitTestingUtils , UserPreferencesService } from '@alfresco/adf-core' ;
27+ import { UnitTestingUtils , UserPreferencesService } from '@alfresco/adf-core' ;
2828import { DocumentListComponent , SitesService } from '@alfresco/adf-content-services' ;
2929import { LibraryListComponent } from './library-list.component' ;
3030import { AppTestingModule } from '../../testing/app-testing.module' ;
@@ -46,8 +46,6 @@ describe('LibraryListComponent', () => {
4646 let appHookService : AppHookService ;
4747 let getSitesSpy : jasmine . Spy < ( options ?: any ) => Observable < SitePaging > > ;
4848 let unitTestingUtils : UnitTestingUtils ;
49- let appConfig : AppConfigService ;
50- let getLegalHoldsEnabledSpy : jasmine . Spy < ( key : string , defaultValue ?: string | boolean ) => string | boolean > ;
5149
5250 const paging : SitePaging = {
5351 list : {
@@ -59,8 +57,6 @@ describe('LibraryListComponent', () => {
5957 }
6058 } ;
6159
62- const whereOpt = `(preset='site-dashboard')` ;
63-
6460 beforeEach ( ( ) => {
6561 TestBed . configureTestingModule ( {
6662 imports : [ AppTestingModule , LibraryListComponent , MatSnackBarModule ] ,
@@ -74,13 +70,10 @@ describe('LibraryListComponent', () => {
7470 sitesService = TestBed . inject ( SitesService ) ;
7571 userPreference = TestBed . inject ( UserPreferencesService ) ;
7672 appHookService = TestBed . inject ( AppHookService ) ;
77- appConfig = TestBed . inject ( AppConfigService ) ;
7873 router = TestBed . inject ( Router ) ;
7974
8075 getSitesSpy = spyOn ( sitesService , 'getSites' ) ;
8176 getSitesSpy . and . returnValue ( of ( paging ) ) ;
82- getLegalHoldsEnabledSpy = spyOn ( appConfig , 'get' ) ;
83- getLegalHoldsEnabledSpy . and . returnValue ( false ) ;
8477 fixture . detectChanges ( ) ;
8578 } ) ;
8679
@@ -93,7 +86,7 @@ describe('LibraryListComponent', () => {
9386 it ( 'should get data with user preference pagination size' , ( ) => {
9487 userPreference . paginationSize = 1 ;
9588 component . ngOnInit ( ) ;
96- expect ( sitesService . getSites ) . toHaveBeenCalledWith ( { maxItems : 1 , where : whereOpt } ) ;
89+ expect ( sitesService . getSites ) . toHaveBeenCalledWith ( { maxItems : 1 } ) ;
9790 } ) ;
9891
9992 it ( 'should set data on error' , ( ) => {
@@ -121,19 +114,6 @@ describe('LibraryListComponent', () => {
121114 } ) ;
122115 } ) ;
123116
124- describe ( 'Legal Holds flag' , ( ) => {
125- it ( 'should call getSites with where option when legal holds disabled' , ( ) => {
126- component . ngOnInit ( ) ;
127- expect ( sitesService . getSites ) . toHaveBeenCalledWith ( jasmine . objectContaining ( { where : whereOpt } ) ) ;
128- } ) ;
129-
130- it ( 'should not call getSites with where option when legal holds enabled' , ( ) => {
131- getLegalHoldsEnabledSpy . and . returnValue ( true ) ;
132- component . ngOnInit ( ) ;
133- expect ( sitesService . getSites ) . toHaveBeenCalledWith ( jasmine . objectContaining ( { where : undefined } ) ) ;
134- } ) ;
135- } ) ;
136-
137117 describe ( 'Node navigation' , ( ) => {
138118 it ( 'should not navigate when node is null or missing guid' , ( ) => {
139119 spyOn ( router , 'navigate' ) . and . stub ( ) ;
@@ -198,12 +178,12 @@ describe('LibraryListComponent', () => {
198178
199179 it ( 'should get list with pagination data onChange event' , ( ) => {
200180 component . getList ( pagination ) ;
201- expect ( sitesService . getSites ) . toHaveBeenCalledWith ( { ... pagination , where : whereOpt } ) ;
181+ expect ( sitesService . getSites ) . toHaveBeenCalledWith ( pagination ) ;
202182 } ) ;
203183
204184 it ( 'should get list with pagination data onChangePageSize event' , ( ) => {
205185 component . onChangePageSize ( pagination ) ;
206- expect ( sitesService . getSites ) . toHaveBeenCalledWith ( { ... pagination , where : whereOpt } ) ;
186+ expect ( sitesService . getSites ) . toHaveBeenCalledWith ( pagination ) ;
207187 } ) ;
208188
209189 it ( 'should set preference page size onChangePageSize event' , ( ) => {
0 commit comments