mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +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 { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { AccessStatusDataService } from '../../../../../core/data/access-status-data.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 { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||||
import { FileService } from '../../../../../core/shared/file.service';
|
import { FileService } from '../../../../../core/shared/file.service';
|
||||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||||
|
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||||
|
|
||||||
describe('ItemAdminSearchResultGridElementComponent', () => {
|
describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||||
let component: ItemAdminSearchResultGridElementComponent;
|
let component: ItemAdminSearchResultGridElementComponent;
|
||||||
@@ -60,7 +63,8 @@ describe('ItemAdminSearchResultGridElementComponent', () => {
|
|||||||
imports: [
|
imports: [
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([])
|
RouterTestingModule.withRoutes([]),
|
||||||
|
ListableModule
|
||||||
],
|
],
|
||||||
declarations: [ItemAdminSearchResultGridElementComponent],
|
declarations: [ItemAdminSearchResultGridElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
@@ -73,7 +77,7 @@ describe('ItemAdminSearchResultGridElementComponent', () => {
|
|||||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -153,7 +153,7 @@ describe('PersonSearchResultListElementComponent', () => {
|
|||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
}), PersonSearchResultListElementComponent, TruncatePipe],
|
}), TruncatePipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
@@ -132,7 +132,6 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
RouterTestingModule,
|
RouterTestingModule,
|
||||||
component,
|
|
||||||
GenericItemPageFieldComponent,
|
GenericItemPageFieldComponent,
|
||||||
TruncatePipe,
|
TruncatePipe,
|
||||||
AsyncPipe,
|
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 { CookieService } from 'src/app/core/services/cookie.service';
|
||||||
import { HardRedirectService } from 'src/app/core/services/hard-redirect.service';
|
import { HardRedirectService } from 'src/app/core/services/hard-redirect.service';
|
||||||
import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock';
|
import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock';
|
||||||
|
import { ListableModule } from '../../../../core/shared/listable.module';
|
||||||
|
|
||||||
const testType = 'TestType';
|
const testType = 'TestType';
|
||||||
const testContext = Context.Search;
|
const testContext = Context.Search;
|
||||||
@@ -44,15 +45,13 @@ describe('ListableObjectComponentLoaderComponent', () => {
|
|||||||
let comp: ListableObjectComponentLoaderComponent;
|
let comp: ListableObjectComponentLoaderComponent;
|
||||||
let fixture: ComponentFixture<ListableObjectComponentLoaderComponent>;
|
let fixture: ComponentFixture<ListableObjectComponentLoaderComponent>;
|
||||||
|
|
||||||
let themeService: ThemeService;
|
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
ListableObjectComponentLoaderComponent,
|
ListableObjectComponentLoaderComponent,
|
||||||
ItemListElementComponent,
|
ListableObjectDirective,
|
||||||
ListableObjectDirective
|
ListableModule
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
providers: [
|
providers: [
|
||||||
|
@@ -35,7 +35,7 @@ export function createSidebarSearchListElementTests(
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), componentClass, VarDirective],
|
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), VarDirective],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
@@ -43,7 +43,7 @@ export function createSidebarSearchListElementTests(
|
|||||||
...extraProviders
|
...extraProviders
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
Reference in New Issue
Block a user