Fix tests

This commit is contained in:
Yury Bondarenko
2024-03-06 11:04:09 +01:00
parent 3b48d9a26d
commit ebbbd64bae
6 changed files with 8 additions and 2 deletions

View File

@@ -415,7 +415,6 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private changeDetectorRef: ChangeDetectorRef, private changeDetectorRef: ChangeDetectorRef,
private location: Location,
private formService: DynamicFormService, private formService: DynamicFormService,
private translate: TranslateService, private translate: TranslateService,
private bitstreamService: BitstreamDataService, private bitstreamService: BitstreamDataService,

View File

@@ -38,6 +38,8 @@ import { PaginationComponentOptions } from '../../shared/pagination/pagination-c
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
import { VarDirective } from '../../shared/utils/var.directive';
import { import {
BrowseByMetadataComponent, BrowseByMetadataComponent,
browseParamsToOptions, browseParamsToOptions,

View File

@@ -7,6 +7,7 @@ import {
TestBed, TestBed,
waitForAsync, waitForAsync,
} from '@angular/core/testing'; } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

View File

@@ -3,7 +3,7 @@
<!-- <!--
Choose a template. Priority: markdown, link, browse link. Choose a template. Priority: markdown, link, browse link.
--> -->
<ng-container *ngTemplateOutlet="(renderMarkdown ? markdown : (hasLink(mdValue) ? (img !== null ? linkImg : link) : (hasBrowseDefinition() ? browselink : simple))); <ng-container *ngTemplateOutlet="(renderMarkdown ? markdown : (hasLink(mdValue) ? (hasValue(img) ? linkImg : link) : (hasBrowseDefinition() ? browselink : simple)));
context: {value: mdValue.value, img}"> context: {value: mdValue.value, img}">
</ng-container> </ng-container>
<span class="separator" *ngIf="!last" [innerHTML]="separator"></span> <span class="separator" *ngIf="!last" [innerHTML]="separator"></span>

View File

@@ -65,6 +65,7 @@ export class MetadataValuesComponent implements OnChanges {
*/ */
renderMarkdown; renderMarkdown;
@Input() browseDefinition?: BrowseDefinition; @Input() browseDefinition?: BrowseDefinition;
/** /**
@@ -72,6 +73,8 @@ export class MetadataValuesComponent implements OnChanges {
*/ */
@Input() img?: ImageField; @Input() img?: ImageField;
hasValue = hasValue;
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
this.renderMarkdown = !!this.appConfig.markdown.enabled && this.enableMarkdown; this.renderMarkdown = !!this.appConfig.markdown.enabled && this.enableMarkdown;
} }

View File

@@ -9,6 +9,7 @@ import {
ReactiveFormsModule, ReactiveFormsModule,
UntypedFormGroup, UntypedFormGroup,
} from '@angular/forms'; } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { import {
DynamicFormsCoreModule, DynamicFormsCoreModule,