11import { ComponentFixture , TestBed , waitForAsync } from '@angular/core/testing' ;
2- import { Component , Injector , NO_ERRORS_SCHEMA } from '@angular/core' ;
2+ import { Component , Injector , NO_ERRORS_SCHEMA , PLATFORM_ID } from '@angular/core' ;
33import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing' ;
44import { By } from '@angular/platform-browser' ;
55
@@ -27,6 +27,7 @@ import { NotificationsServiceStub } from '../testing/notifications-service.stub'
2727import { AuthService } from '../../core/auth/auth.service' ;
2828import { EPersonMock } from '../testing/eperson.mock' ;
2929import { ItemExportFormConfiguration , ItemExportService } from '../search/item-export/item-export.service' ;
30+ import { BrowserOnlyDirective } from '../utils/browser-only.directive' ;
3031
3132describe ( 'ContextMenuComponent' , ( ) => {
3233 let component : ContextMenuComponent ;
@@ -98,7 +99,8 @@ describe('ContextMenuComponent', () => {
9899 useClass : TranslateLoaderMock
99100 }
100101 } ) ,
101- NgbDropdownModule
102+ NgbDropdownModule ,
103+ BrowserOnlyDirective
102104 ] ,
103105 declarations : [ ContextMenuComponent , TestComponent , ExportItemMenuComponent , StatisticsMenuComponent , SubscriptionMenuComponent ] ,
104106 providers : [
@@ -110,6 +112,7 @@ describe('ContextMenuComponent', () => {
110112 { provide : AuthService , useValue : authService } ,
111113 { provide : AuthorizationDataService , useValue : authorizationDataService } ,
112114 { provide : NotificationsService , useValue : new NotificationsServiceStub ( ) } ,
115+ { provide : PLATFORM_ID , useValue : 'browser' } ,
113116 Injector
114117 ] ,
115118 schemas : [ NO_ERRORS_SCHEMA ]
0 commit comments