Skip to content

Commit 9c0ff74

Browse files
author
Andrea Barbasso
committed
[UXP-170] fix test
1 parent 138b496 commit 9c0ff74

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/app/shared/explore/section-component/grid-section/grid-section.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { NotificationsService } from '../../../notifications/notifications.servi
4343
import { createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils';
4444
import { SearchResult } from '../../../search/models/search-result.model';
4545
import { GridSectionComponent } from './grid-section.component';
46+
import { MathService } from '../../../../core/shared/math.service';
4647

4748
describe('GridSectionComponent', () => {
4849
let component: GridSectionComponent;
@@ -108,6 +109,7 @@ describe('GridSectionComponent', () => {
108109
{ provide: DSOChangeAnalyzer, useValue: {} },
109110
{ provide: BitstreamFormatDataService, useValue: {} },
110111
{ provide: NotificationsService, useValue: {} },
112+
{ provide: MathService, useValue: {} },
111113
{
112114
provide: ChangeDetectorRef, useValue: {
113115
detectChanges: () => fixture.detectChanges(),

src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ describe('ItemDetailPreviewFieldComponent', () => {
9090
fixture.detectChanges();
9191
});
9292

93-
it('should render a ds-markdown-viewer', () => {
94-
const mdViewer = fixture.debugElement.query(By.css('ds-markdown-viewer'));
95-
expect(mdViewer).not.toBeNull();
96-
});
97-
9893
it('should display placeholder when metadata has no value', () => {
9994
component.metadata = 'dc.abstract';
10095
component.placeholder = 'No abstract';

src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import { ThemeService } from '../../../../theme-support/theme.service';
3434
import { TruncatableService } from '../../../../truncatable/truncatable.service';
3535
import { TruncatePipe } from '../../../../utils/truncate.pipe';
3636
import { ItemListElementComponent } from './item-list-element.component';
37+
import { MathService } from '../../../../../core/shared/math.service';
38+
import { FileService } from '../../../../../core/shared/file.service';
39+
import { FileServiceStub } from '../../../../testing/file-service.stub';
3740

3841
const mockItem: Item = Object.assign(new Item(), {
3942
bundles: observableOf({}),
@@ -84,13 +87,15 @@ describe('ItemListElementComponent', () => {
8487
let activatedRoute: ActivatedRouteStub;
8588
let authService: AuthServiceStub;
8689
let authorizationService: AuthorizationDataServiceStub;
90+
let fileService: FileServiceStub;
8791
let themeService: ThemeService;
8892
let truncatableService: TruncatableServiceStub;
8993

9094
beforeEach(waitForAsync(() => {
9195
activatedRoute = new ActivatedRouteStub();
9296
authService = new AuthServiceStub();
9397
authorizationService = new AuthorizationDataServiceStub();
98+
fileService = new FileServiceStub();
9499
themeService = getMockThemeService();
95100
truncatableService = new TruncatableServiceStub();
96101

@@ -105,6 +110,9 @@ describe('ItemListElementComponent', () => {
105110
{ provide: ActivatedRoute, useValue: activatedRoute },
106111
{ provide: AuthService, useValue: authService },
107112
{ provide: AuthorizationDataService, useValue: authorizationService },
113+
{ provide: XSRFService, useValue: {} },
114+
{ provide: MathService, useValue: {} },
115+
{ provide: FileService, useValue: fileService },
108116
{ provide: ThemeService, useValue: themeService },
109117
{ provide: TruncatableService, useValue: truncatableService },
110118
{ provide: XSRFService, useValue: {} },

0 commit comments

Comments
 (0)