mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[DURACOM-191] fix tests
This commit is contained in:
@@ -18,13 +18,16 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-
|
||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||
import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service';
|
||||
import { AccessStatusObject } from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||
import {
|
||||
AccessStatusObject
|
||||
} from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||
import { FileService } from '../../../../../core/shared/file.service';
|
||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||
|
||||
describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||
let component: ItemAdminSearchResultGridElementComponent;
|
||||
@@ -57,23 +60,24 @@ describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||
init();
|
||||
TestBed.configureTestingModule(
|
||||
{
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([])
|
||||
],
|
||||
declarations: [ItemAdminSearchResultGridElementComponent],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||
{ provide: ThemeService, useValue: mockThemeService },
|
||||
{ provide: AccessStatusDataService, useValue: mockAccessStatusDataService },
|
||||
{ provide: AuthService, useClass: AuthServiceStub },
|
||||
{ provide: FileService, useClass: FileServiceStub },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule
|
||||
],
|
||||
declarations: [ItemAdminSearchResultGridElementComponent],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||
{ provide: ThemeService, useValue: mockThemeService },
|
||||
{ provide: AccessStatusDataService, useValue: mockAccessStatusDataService },
|
||||
{ provide: AuthService, useClass: AuthServiceStub },
|
||||
{ provide: FileService, useClass: FileServiceStub },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -153,7 +153,7 @@ describe('PersonSearchResultListElementComponent', () => {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
}), PersonSearchResultListElementComponent, TruncatePipe],
|
||||
}), TruncatePipe],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
|
@@ -132,7 +132,6 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
||||
},
|
||||
}),
|
||||
RouterTestingModule,
|
||||
component,
|
||||
GenericItemPageFieldComponent,
|
||||
TruncatePipe,
|
||||
AsyncPipe,
|
||||
|
@@ -23,6 +23,7 @@ import { CookieServiceMock } from 'src/app/shared/mocks/cookie.service.mock';
|
||||
import { CookieService } from 'src/app/core/services/cookie.service';
|
||||
import { HardRedirectService } from 'src/app/core/services/hard-redirect.service';
|
||||
import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock';
|
||||
import { ListableModule } from '../../../../core/shared/listable.module';
|
||||
|
||||
const testType = 'TestType';
|
||||
const testContext = Context.Search;
|
||||
@@ -44,15 +45,13 @@ describe('ListableObjectComponentLoaderComponent', () => {
|
||||
let comp: ListableObjectComponentLoaderComponent;
|
||||
let fixture: ComponentFixture<ListableObjectComponentLoaderComponent>;
|
||||
|
||||
let themeService: ThemeService;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ListableObjectComponentLoaderComponent,
|
||||
ItemListElementComponent,
|
||||
ListableObjectDirective
|
||||
ListableObjectDirective,
|
||||
ListableModule
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
providers: [
|
||||
|
@@ -35,15 +35,15 @@ export function createSidebarSearchListElementTests(
|
||||
})
|
||||
});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), componentClass, VarDirective],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
DSONameService,
|
||||
...extraProviders
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), VarDirective],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
DSONameService,
|
||||
...extraProviders
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
Reference in New Issue
Block a user