mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 19:43:04 +00:00
fix broken tests
This commit is contained in:
@@ -10,6 +10,8 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
|
||||||
let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent;
|
let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<JournalIssueSearchResultListElementComponent>;
|
let fixture: ComponentFixture<JournalIssueSearchResultListElementComponent>;
|
||||||
@@ -77,7 +79,8 @@ describe('JournalIssueSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
|
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
|
||||||
@@ -164,7 +167,8 @@ describe('JournalIssueSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: enviromentNoThumbs }
|
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
|
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
|
||||||
|
@@ -10,6 +10,8 @@ import { TruncatableService } from '../../../../../shared/truncatable/truncatabl
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
|
||||||
let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent;
|
let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<JournalVolumeSearchResultListElementComponent>;
|
let fixture: ComponentFixture<JournalVolumeSearchResultListElementComponent>;
|
||||||
@@ -76,7 +78,8 @@ describe('JournalVolumeSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalVolumeSearchResultListElementComponent, {
|
}).overrideComponent(JournalVolumeSearchResultListElementComponent, {
|
||||||
@@ -162,7 +165,8 @@ describe('JournalVolumeSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: enviromentNoThumbs }
|
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalVolumeSearchResultListElementComponent, {
|
}).overrideComponent(JournalVolumeSearchResultListElementComponent, {
|
||||||
|
@@ -10,6 +10,8 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared
|
|||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
|
||||||
let journalListElementComponent: JournalSearchResultListElementComponent;
|
let journalListElementComponent: JournalSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<JournalSearchResultListElementComponent>;
|
let fixture: ComponentFixture<JournalSearchResultListElementComponent>;
|
||||||
@@ -72,7 +74,8 @@ describe('JournalSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalSearchResultListElementComponent, {
|
}).overrideComponent(JournalSearchResultListElementComponent, {
|
||||||
@@ -134,7 +137,8 @@ describe('JournalSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: enviromentNoThumbs }
|
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalSearchResultListElementComponent, {
|
}).overrideComponent(JournalSearchResultListElementComponent, {
|
||||||
|
@@ -12,6 +12,8 @@ import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service
|
|||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
|
||||||
let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent;
|
let orgUnitListElementComponent: OrgUnitSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<OrgUnitSearchResultListElementComponent>;
|
let fixture: ComponentFixture<OrgUnitSearchResultListElementComponent>;
|
||||||
@@ -77,7 +79,8 @@ describe('OrgUnitSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
|
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
|
||||||
@@ -144,7 +147,8 @@ describe('OrgUnitSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: enviromentNoThumbs }
|
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
|
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
|
||||||
|
@@ -12,6 +12,8 @@ import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service
|
|||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
|
||||||
let personListElementComponent: PersonSearchResultListElementComponent;
|
let personListElementComponent: PersonSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<PersonSearchResultListElementComponent>;
|
let fixture: ComponentFixture<PersonSearchResultListElementComponent>;
|
||||||
@@ -77,7 +79,8 @@ describe('PersonSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(PersonSearchResultListElementComponent, {
|
}).overrideComponent(PersonSearchResultListElementComponent, {
|
||||||
@@ -144,7 +147,8 @@ describe('PersonSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: enviromentNoThumbs }
|
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(PersonSearchResultListElementComponent, {
|
}).overrideComponent(PersonSearchResultListElementComponent, {
|
||||||
|
@@ -10,6 +10,8 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
|||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
|
||||||
let projectListElementComponent: ProjectSearchResultListElementComponent;
|
let projectListElementComponent: ProjectSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<ProjectSearchResultListElementComponent>;
|
let fixture: ComponentFixture<ProjectSearchResultListElementComponent>;
|
||||||
@@ -71,7 +73,8 @@ describe('ProjectSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ProjectSearchResultListElementComponent, {
|
}).overrideComponent(ProjectSearchResultListElementComponent, {
|
||||||
@@ -133,7 +136,8 @@ describe('ProjectSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: enviromentNoThumbs }
|
{ provide: APP_CONFIG, useValue: enviromentNoThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ProjectSearchResultListElementComponent, {
|
}).overrideComponent(ProjectSearchResultListElementComponent, {
|
||||||
|
@@ -3,6 +3,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { ImportExternalPageComponent } from './import-external-page.component';
|
import { ImportExternalPageComponent } from './import-external-page.component';
|
||||||
import { ThemeService } from '../shared/theme-support/theme.service';
|
import { ThemeService } from '../shared/theme-support/theme.service';
|
||||||
import { getMockThemeService } from '../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../shared/mocks/theme-service.mock';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../shared/testing/active-router.stub';
|
||||||
|
|
||||||
describe('ImportExternalPageComponent', () => {
|
describe('ImportExternalPageComponent', () => {
|
||||||
let component: ImportExternalPageComponent;
|
let component: ImportExternalPageComponent;
|
||||||
@@ -13,6 +15,7 @@ describe('ImportExternalPageComponent', () => {
|
|||||||
imports: [ImportExternalPageComponent],
|
imports: [ImportExternalPageComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
|
@@ -23,12 +23,12 @@ import { UUIDService } from '../../../../core/shared/uuid.service';
|
|||||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||||
import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import {
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
createSuccessfulRemoteDataObject$
|
|
||||||
} from '../../../../shared/remote-data.utils';
|
|
||||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||||
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
|
import {
|
||||||
|
GenericItemPageFieldComponent
|
||||||
|
} from '../../field-components/specific-field/generic/generic-item-page-field.component';
|
||||||
import { compareArraysUsing, compareArraysUsingIds } from './item-relationships-utils';
|
import { compareArraysUsing, compareArraysUsingIds } from './item-relationships-utils';
|
||||||
import { createPaginatedList } from '../../../../shared/testing/utils.test';
|
import { createPaginatedList } from '../../../../shared/testing/utils.test';
|
||||||
import { RouteService } from '../../../../core/services/route.service';
|
import { RouteService } from '../../../../core/services/route.service';
|
||||||
@@ -41,14 +41,16 @@ import { RouterTestingModule } from '@angular/router/testing';
|
|||||||
import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { ResearcherProfileDataService } from '../../../../core/profile/researcher-profile-data.service';
|
import { ResearcherProfileDataService } from '../../../../core/profile/researcher-profile-data.service';
|
||||||
import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service';
|
import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service';
|
||||||
import {
|
import { BrowseDefinitionDataServiceStub } from '../../../../shared/testing/browse-definition-data-service.stub';
|
||||||
BrowseDefinitionDataServiceStub
|
|
||||||
} from '../../../../shared/testing/browse-definition-data-service.stub';
|
|
||||||
|
|
||||||
import { buildPaginatedList } from '../../../../core/data/paginated-list.model';
|
import { buildPaginatedList } from '../../../../core/data/paginated-list.model';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { ItemComponent } from './item.component';
|
import { ItemComponent } from './item.component';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
|
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||||
|
|
||||||
|
|
||||||
export function getIIIFSearchEnabled(enabled: boolean): MetadataValue {
|
export function getIIIFSearchEnabled(enabled: boolean): MetadataValue {
|
||||||
return Object.assign(new MetadataValue(), {
|
return Object.assign(new MetadataValue(), {
|
||||||
@@ -73,6 +75,12 @@ export function getIIIFEnabled(enabled: boolean): MetadataValue {
|
|||||||
export const mockRouteService = {
|
export const mockRouteService = {
|
||||||
getPreviousUrl(): Observable<string> {
|
getPreviousUrl(): Observable<string> {
|
||||||
return observableOf('');
|
return observableOf('');
|
||||||
|
},
|
||||||
|
getQueryParameterValue(): Observable<string> {
|
||||||
|
return observableOf('');
|
||||||
|
},
|
||||||
|
getRouteParameterValue(): Observable<string> {
|
||||||
|
return observableOf('');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -87,6 +95,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
return () => {
|
return () => {
|
||||||
let comp: any;
|
let comp: any;
|
||||||
let fixture: ComponentFixture<any>;
|
let fixture: ComponentFixture<any>;
|
||||||
|
let relationshipService: jasmine.SpyObj<RelationshipDataService>;
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
const mockBitstreamDataService = {
|
const mockBitstreamDataService = {
|
||||||
@@ -99,6 +108,10 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
isAuthorized: observableOf(true)
|
isAuthorized: observableOf(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
relationshipService = jasmine.createSpyObj('relationshipService', {
|
||||||
|
getRelatedItemsByLabel: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])),
|
||||||
|
});
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
@@ -111,12 +124,19 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
component, GenericItemPageFieldComponent, TruncatePipe
|
component, GenericItemPageFieldComponent, TruncatePipe
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
{
|
||||||
|
provide: APP_CONFIG,
|
||||||
|
useValue: {
|
||||||
|
browseBy: { showThumbnails: true },
|
||||||
|
markdown: { enabled: true }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
provideMockStore(),
|
||||||
{ provide: ItemDataService, useValue: {} },
|
{ provide: ItemDataService, useValue: {} },
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: RelationshipDataService, useValue: {} },
|
{ provide: RelationshipDataService, useValue: relationshipService },
|
||||||
{ provide: ObjectCacheService, useValue: {} },
|
{ provide: ObjectCacheService, useValue: {} },
|
||||||
{ provide: UUIDService, useValue: {} },
|
{ provide: UUIDService, useValue: {} },
|
||||||
{ provide: Store, useValue: {} },
|
|
||||||
{ provide: RemoteDataBuildService, useValue: {} },
|
{ provide: RemoteDataBuildService, useValue: {} },
|
||||||
{ provide: CommunityDataService, useValue: {} },
|
{ provide: CommunityDataService, useValue: {} },
|
||||||
{ provide: HALEndpointService, useValue: {} },
|
{ provide: HALEndpointService, useValue: {} },
|
||||||
@@ -129,7 +149,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||||
{ provide: WorkspaceitemDataService, useValue: {} },
|
{ provide: WorkspaceitemDataService, useValue: {} },
|
||||||
{ provide: SearchService, useValue: {} },
|
{ provide: SearchService, useValue: {} },
|
||||||
{ provide: RouteService, useValue: mockRouteService },
|
{ provide: RouteService, useValue: routeServiceStub },
|
||||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||||
{ provide: ResearcherProfileDataService, useValue: {} },
|
{ provide: ResearcherProfileDataService, useValue: {} },
|
||||||
{ provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub },
|
{ provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub },
|
||||||
|
@@ -18,6 +18,13 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|||||||
import { TranslateLoaderMock } from '../../../../testing/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../../testing/translate-loader.mock';
|
||||||
import { SubmissionService } from '../../../../../submission/submission.service';
|
import { SubmissionService } from '../../../../../submission/submission.service';
|
||||||
import { SubmissionServiceStub } from '../../../../testing/submission-service.stub';
|
import { SubmissionServiceStub } from '../../../../testing/submission-service.stub';
|
||||||
|
import { getMockThemeService } from '../../../../mocks/theme-service.mock';
|
||||||
|
import { ThemeService } from '../../../../theme-support/theme.service';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../../../testing/active-router.stub';
|
||||||
|
import {
|
||||||
|
ItemSearchResultListElementComponent
|
||||||
|
} from '../../../../object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||||
|
|
||||||
describe('ExistingMetadataListElementComponent', () => {
|
describe('ExistingMetadataListElementComponent', () => {
|
||||||
let component: ExistingMetadataListElementComponent;
|
let component: ExistingMetadataListElementComponent;
|
||||||
@@ -85,9 +92,14 @@ describe('ExistingMetadataListElementComponent', () => {
|
|||||||
{ provide: SelectableListService, useValue: selectionService },
|
{ provide: SelectableListService, useValue: selectionService },
|
||||||
{ provide: Store, useValue: store },
|
{ provide: Store, useValue: store },
|
||||||
{ provide: SubmissionService, useValue: submissionServiceStub },
|
{ provide: SubmissionService, useValue: submissionServiceStub },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
|
.overrideComponent(ExistingMetadataListElementComponent, {
|
||||||
|
remove: { imports: [ItemSearchResultListElementComponent]}
|
||||||
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import {
|
import {
|
||||||
DynamicFormArrayModel,
|
DynamicFormArrayModel,
|
||||||
@@ -138,7 +137,6 @@ describe('FormComponent test suite', () => {
|
|||||||
/* TODO make sure these files use mocks instead of real services/components https://github.com/DSpace/dspace-angular/issues/281 */
|
/* TODO make sure these files use mocks instead of real services/components https://github.com/DSpace/dspace-angular/issues/281 */
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@@ -439,7 +437,7 @@ describe('FormComponent test suite', () => {
|
|||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [BrowserModule,
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
@@ -13,6 +13,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { ThemeService } from '../../../theme-support/theme.service';
|
import { ThemeService } from '../../../theme-support/theme.service';
|
||||||
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
|
||||||
const testType = 'TestType';
|
const testType = 'TestType';
|
||||||
const testContext = Context.Search;
|
const testContext = Context.Search;
|
||||||
@@ -35,16 +36,21 @@ describe('ListableObjectComponentLoaderComponent', () => {
|
|||||||
getThemeName: 'dspace',
|
getThemeName: 'dspace',
|
||||||
});
|
});
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), ListableObjectComponentLoaderComponent, ItemListElementComponent, ListableObjectDirective],
|
imports: [
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
TranslateModule.forRoot(),
|
||||||
providers: [
|
ListableObjectComponentLoaderComponent,
|
||||||
provideMockStore({}),
|
ItemListElementComponent,
|
||||||
{ provide: ThemeService, useValue: themeService },
|
ListableObjectDirective
|
||||||
]
|
],
|
||||||
}).overrideComponent(ListableObjectComponentLoaderComponent, {
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
set: {
|
providers: [
|
||||||
|
provideMockStore({}),
|
||||||
|
{ provide: ThemeService, useValue: themeService },
|
||||||
|
{ provide: APP_CONFIG, useValue: { browseBy: { showThumbnails: true } } }
|
||||||
|
]
|
||||||
|
}).overrideComponent(ListableObjectComponentLoaderComponent, {
|
||||||
|
add: {
|
||||||
changeDetection: ChangeDetectionStrategy.Default,
|
changeDetection: ChangeDetectionStrategy.Default,
|
||||||
entryComponents: [ItemListElementComponent]
|
|
||||||
}
|
}
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -5,6 +5,8 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { Collection } from '../../../core/shared/collection.model';
|
import { Collection } from '../../../core/shared/collection.model';
|
||||||
import { LinkService } from '../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../core/cache/builders/link.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../testing/active-router.stub';
|
||||||
|
|
||||||
let collectionGridElementComponent: CollectionGridElementComponent;
|
let collectionGridElementComponent: CollectionGridElementComponent;
|
||||||
let fixture: ComponentFixture<CollectionGridElementComponent>;
|
let fixture: ComponentFixture<CollectionGridElementComponent>;
|
||||||
@@ -44,7 +46,8 @@ describe('CollectionGridElementComponent', () => {
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
|
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
|
||||||
{ provide: LinkService, useValue: linkService }
|
{ provide: LinkService, useValue: linkService },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CollectionGridElementComponent, {
|
}).overrideComponent(CollectionGridElementComponent, {
|
||||||
|
@@ -5,6 +5,8 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { Community } from '../../../core/shared/community.model';
|
import { Community } from '../../../core/shared/community.model';
|
||||||
import { LinkService } from '../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../core/cache/builders/link.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../testing/active-router.stub';
|
||||||
|
|
||||||
let communityGridElementComponent: CommunityGridElementComponent;
|
let communityGridElementComponent: CommunityGridElementComponent;
|
||||||
let fixture: ComponentFixture<CommunityGridElementComponent>;
|
let fixture: ComponentFixture<CommunityGridElementComponent>;
|
||||||
@@ -44,7 +46,8 @@ describe('CommunityGridElementComponent', () => {
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) },
|
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) },
|
||||||
{ provide: LinkService, useValue: linkService }
|
{ provide: LinkService, useValue: linkService },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CommunityGridElementComponent, {
|
}).overrideComponent(CommunityGridElementComponent, {
|
||||||
|
@@ -70,6 +70,7 @@ describe('CollectionSearchResultGridElementComponent', () => {
|
|||||||
CollectionSearchResultGridElementComponent, TruncatePipe
|
CollectionSearchResultGridElementComponent, TruncatePipe
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||||
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
|
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
|
||||||
{ provide: ObjectCacheService, useValue: {} },
|
{ provide: ObjectCacheService, useValue: {} },
|
||||||
|
@@ -21,6 +21,8 @@ import { CommunitySearchResultGridElementComponent } from './community-search-re
|
|||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../../testing/active-router.stub';
|
||||||
|
|
||||||
let communitySearchResultGridElementComponent: CommunitySearchResultGridElementComponent;
|
let communitySearchResultGridElementComponent: CommunitySearchResultGridElementComponent;
|
||||||
let fixture: ComponentFixture<CommunitySearchResultGridElementComponent>;
|
let fixture: ComponentFixture<CommunitySearchResultGridElementComponent>;
|
||||||
@@ -80,7 +82,8 @@ describe('CommunitySearchResultGridElementComponent', () => {
|
|||||||
{ provide: DSOChangeAnalyzer, useValue: {} },
|
{ provide: DSOChangeAnalyzer, useValue: {} },
|
||||||
{ provide: DefaultChangeAnalyzer, useValue: {} },
|
{ provide: DefaultChangeAnalyzer, useValue: {} },
|
||||||
{ provide: BitstreamFormatDataService, useValue: {} },
|
{ provide: BitstreamFormatDataService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService }
|
{ provide: LinkService, useValue: linkService },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CommunitySearchResultGridElementComponent, {
|
}).overrideComponent(CommunitySearchResultGridElementComponent, {
|
||||||
|
@@ -5,6 +5,8 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { Collection } from '../../../core/shared/collection.model';
|
import { Collection } from '../../../core/shared/collection.model';
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../mocks/dso-name.service.mock';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../testing/active-router.stub';
|
||||||
|
|
||||||
let collectionListElementComponent: CollectionListElementComponent;
|
let collectionListElementComponent: CollectionListElementComponent;
|
||||||
let fixture: ComponentFixture<CollectionListElementComponent>;
|
let fixture: ComponentFixture<CollectionListElementComponent>;
|
||||||
@@ -60,7 +62,8 @@ describe('CollectionListElementComponent', () => {
|
|||||||
imports: [CollectionListElementComponent],
|
imports: [CollectionListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) }
|
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CollectionListElementComponent, {
|
}).overrideComponent(CollectionListElementComponent, {
|
||||||
|
@@ -5,6 +5,8 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { Community } from '../../../core/shared/community.model';
|
import { Community } from '../../../core/shared/community.model';
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../mocks/dso-name.service.mock';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../testing/active-router.stub';
|
||||||
|
|
||||||
let communityListElementComponent: CommunityListElementComponent;
|
let communityListElementComponent: CommunityListElementComponent;
|
||||||
let fixture: ComponentFixture<CommunityListElementComponent>;
|
let fixture: ComponentFixture<CommunityListElementComponent>;
|
||||||
@@ -37,7 +39,8 @@ describe('CommunityListElementComponent', () => {
|
|||||||
imports: [CommunityListElementComponent],
|
imports: [CommunityListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) }
|
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CommunityListElementComponent, {
|
}).overrideComponent(CommunityListElementComponent, {
|
||||||
|
@@ -4,6 +4,8 @@ import { PlainTextMetadataListElementComponent } from './plain-text-metadata-lis
|
|||||||
import { MetadatumRepresentation } from '../../../../core/shared/metadata-representation/metadatum/metadatum-representation.model';
|
import { MetadatumRepresentation } from '../../../../core/shared/metadata-representation/metadatum/metadatum-representation.model';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { mockData } from '../../../testing/browse-definition-data-service.stub';
|
import { mockData } from '../../../testing/browse-definition-data-service.stub';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../../testing/active-router.stub';
|
||||||
|
|
||||||
// Render the mock representation with the default mock author browse definition so it is also rendered as a link
|
// Render the mock representation with the default mock author browse definition so it is also rendered as a link
|
||||||
// without affecting other tests
|
// without affecting other tests
|
||||||
@@ -19,6 +21,7 @@ describe('PlainTextMetadataListElementComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [PlainTextMetadataListElementComponent],
|
imports: [PlainTextMetadataListElementComponent],
|
||||||
|
providers: [{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(PlainTextMetadataListElementComponent, {
|
}).overrideComponent(PlainTextMetadataListElementComponent, {
|
||||||
set: { changeDetection: ChangeDetectionStrategy.Default }
|
set: { changeDetection: ChangeDetectionStrategy.Default }
|
||||||
|
@@ -14,6 +14,8 @@ import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
|||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
import { environment } from '../../../../../environments/environment';
|
import { environment } from '../../../../../environments/environment';
|
||||||
import { Context } from '../../../../core/shared/context.model';
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
import { ThemeService } from '../../../theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../mocks/theme-service.mock';
|
||||||
|
|
||||||
let component: ItemSearchResultListElementSubmissionComponent;
|
let component: ItemSearchResultListElementSubmissionComponent;
|
||||||
let fixture: ComponentFixture<ItemSearchResultListElementSubmissionComponent>;
|
let fixture: ComponentFixture<ItemSearchResultListElementSubmissionComponent>;
|
||||||
@@ -58,7 +60,8 @@ describe('ItemMyDSpaceResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: {} },
|
{ provide: TruncatableService, useValue: {} },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environment }
|
{ provide: APP_CONFIG, useValue: environment },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ItemSearchResultListElementSubmissionComponent, {
|
}).overrideComponent(ItemSearchResultListElementSubmissionComponent, {
|
||||||
|
@@ -27,6 +27,8 @@ import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
|||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||||
import { Context } from '../../../../core/shared/context.model';
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
import { ThemeService } from '../../../theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../mocks/theme-service.mock';
|
||||||
|
|
||||||
let component: PoolSearchResultListElementComponent;
|
let component: PoolSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<PoolSearchResultListElementComponent>;
|
let fixture: ComponentFixture<PoolSearchResultListElementComponent>;
|
||||||
@@ -88,7 +90,8 @@ describe('PoolSearchResultListElementComponent', () => {
|
|||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
{ provide: ObjectCacheService, useValue: objectCacheServiceMock }
|
{ provide: ObjectCacheService, useValue: objectCacheServiceMock },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(PoolSearchResultListElementComponent, {
|
}).overrideComponent(PoolSearchResultListElementComponent, {
|
||||||
|
@@ -19,6 +19,8 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
|||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
import { Context } from '../../../../core/shared/context.model';
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
|
import { ThemeService } from '../../../theme-support/theme.service';
|
||||||
|
import { getMockThemeService } from '../../../mocks/theme-service.mock';
|
||||||
|
|
||||||
let component: WorkspaceItemSearchResultListElementComponent;
|
let component: WorkspaceItemSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<WorkspaceItemSearchResultListElementComponent>;
|
let fixture: ComponentFixture<WorkspaceItemSearchResultListElementComponent>;
|
||||||
@@ -76,7 +78,8 @@ describe('WorkspaceItemSearchResultListElementComponent', () => {
|
|||||||
{ provide: ItemDataService, useValue: {} },
|
{ provide: ItemDataService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(WorkspaceItemSearchResultListElementComponent, {
|
}).overrideComponent(WorkspaceItemSearchResultListElementComponent, {
|
||||||
|
@@ -10,6 +10,8 @@ import { CollectionSearchResult } from '../../../object-collection/shared/collec
|
|||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../../testing/active-router.stub';
|
||||||
|
|
||||||
let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent;
|
let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<CollectionSearchResultListElementComponent>;
|
let fixture: ComponentFixture<CollectionSearchResultListElementComponent>;
|
||||||
@@ -57,7 +59,8 @@ describe('CollectionSearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CollectionSearchResultListElementComponent, {
|
}).overrideComponent(CollectionSearchResultListElementComponent, {
|
||||||
|
@@ -10,6 +10,8 @@ import { CommunitySearchResult } from '../../../object-collection/shared/communi
|
|||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||||
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../config/app-config.interface';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ActivatedRouteStub } from '../../../testing/active-router.stub';
|
||||||
|
|
||||||
let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent;
|
let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent;
|
||||||
let fixture: ComponentFixture<CommunitySearchResultListElementComponent>;
|
let fixture: ComponentFixture<CommunitySearchResultListElementComponent>;
|
||||||
@@ -57,7 +59,8 @@ describe('CommunitySearchResultListElementComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
{ provide: TruncatableService, useValue: truncatableServiceStub },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
|
{ provide: APP_CONFIG, useValue: environmentUseThumbs },
|
||||||
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(CommunitySearchResultListElementComponent, {
|
}).overrideComponent(CommunitySearchResultListElementComponent, {
|
||||||
|
@@ -383,6 +383,7 @@ describe('Pagination component', () => {
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule,
|
imports: [CommonModule,
|
||||||
NgxPaginationModule,
|
NgxPaginationModule,
|
||||||
|
PaginationComponent,
|
||||||
NgbModule]
|
NgbModule]
|
||||||
})
|
})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
@@ -138,7 +137,6 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@@ -251,7 +249,7 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => {
|
|||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [BrowserModule,
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
@@ -114,7 +113,6 @@ describe('SubmissionSectionLicenseComponent test suite', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@@ -325,7 +323,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => {
|
|||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [BrowserModule,
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule]
|
ReactiveFormsModule]
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
@@ -47,6 +46,7 @@ import {
|
|||||||
} from '../../../../../core/json-patch/builder/json-patch-operation-path-combiner';
|
} from '../../../../../core/json-patch/builder/json-patch-operation-path-combiner';
|
||||||
import { dateToISOFormat } from '../../../../../shared/date.util';
|
import { dateToISOFormat } from '../../../../../shared/date.util';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
|
|
||||||
const jsonPatchOpBuilder: any = jasmine.createSpyObj('jsonPatchOpBuilder', {
|
const jsonPatchOpBuilder: any = jasmine.createSpyObj('jsonPatchOpBuilder', {
|
||||||
add: jasmine.createSpy('add'),
|
add: jasmine.createSpy('add'),
|
||||||
@@ -83,7 +83,6 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@@ -98,6 +97,7 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => {
|
|||||||
{ provide: SubmissionJsonPatchOperationsService, useValue: submissionJsonPatchOperationsServiceStub },
|
{ provide: SubmissionJsonPatchOperationsService, useValue: submissionJsonPatchOperationsServiceStub },
|
||||||
{ provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder },
|
{ provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder },
|
||||||
{ provide: SectionUploadService, useValue: getMockSectionUploadService() },
|
{ provide: SectionUploadService, useValue: getMockSectionUploadService() },
|
||||||
|
provideMockStore(),
|
||||||
FormBuilderService,
|
FormBuilderService,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
SubmissionSectionUploadFileEditComponent,
|
SubmissionSectionUploadFileEditComponent,
|
||||||
@@ -135,11 +135,10 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => {
|
|||||||
testFixture.destroy();
|
testFixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create SubmissionSectionUploadFileEditComponent', inject([SubmissionSectionUploadFileEditComponent], (app: SubmissionSectionUploadFileEditComponent) => {
|
it('should create SubmissionSectionUploadFileEditComponent', () => {
|
||||||
|
let app = TestBed.inject(SubmissionSectionUploadFileEditComponent);
|
||||||
expect(app).toBeDefined();
|
expect(app).toBeDefined();
|
||||||
|
});
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('', () => {
|
describe('', () => {
|
||||||
@@ -317,10 +316,11 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => {
|
|||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [BrowserModule,
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule]
|
ReactiveFormsModule
|
||||||
|
]
|
||||||
})
|
})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
import { of, of as observableOf } from 'rxjs';
|
import { of, of as observableOf } from 'rxjs';
|
||||||
@@ -77,7 +77,6 @@ describe('SubmissionSectionUploadFileComponent test suite', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
NgbModule,
|
NgbModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
@@ -237,7 +236,7 @@ describe('SubmissionSectionUploadFileComponent test suite', () => {
|
|||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [BrowserModule,
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
NgbModule]
|
NgbModule]
|
||||||
})
|
})
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -164,7 +163,6 @@ describe('SubmissionSectionUploadComponent test suite', () => {
|
|||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
SubmissionSectionUploadComponent,
|
SubmissionSectionUploadComponent,
|
||||||
@@ -366,7 +364,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
|
|||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [BrowserModule,
|
imports: [
|
||||||
CommonModule]
|
CommonModule]
|
||||||
})
|
})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
|
Reference in New Issue
Block a user