mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
71894: WIP: fix EditInPlace tests
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
[ngModelOptions]="{standalone: true}"
|
||||
></ds-filter-input-suggestions>
|
||||
</div>
|
||||
<small class="text-danger"
|
||||
*ngIf="(valid | async) === false">{{"item.edit.metadata.metadatafield.invalid" | translate}}</small>
|
||||
</div>
|
||||
</td>
|
||||
<td class="w-100">
|
||||
|
@@ -17,6 +17,7 @@ import { MetadatumViewModel } from '../../../../core/shared/metadata.models';
|
||||
import { InputSuggestion } from '../../../../shared/input-suggestions/input-suggestions.model';
|
||||
import { SharedModule } from '../../../../shared/shared.module';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||
import { followLink } from '../../../../shared/utils/follow-link-config.model';
|
||||
import { EditInPlaceFieldComponent } from './edit-in-place-field.component';
|
||||
|
||||
let comp: EditInPlaceFieldComponent;
|
||||
@@ -57,7 +58,7 @@ const fieldUpdate = {
|
||||
};
|
||||
let scheduler: TestScheduler;
|
||||
|
||||
fdescribe('EditInPlaceFieldComponent', () => {
|
||||
describe('EditInPlaceFieldComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
scheduler = getTestScheduler();
|
||||
@@ -211,7 +212,7 @@ fdescribe('EditInPlaceFieldComponent', () => {
|
||||
|
||||
it('it should call queryMetadataFields on the metadataFieldService with the correct query', () => {
|
||||
|
||||
expect(metadataFieldService.queryMetadataFields).toHaveBeenCalledWith(query);
|
||||
expect(metadataFieldService.queryMetadataFields).toHaveBeenCalledWith(query, null, followLink('schema'));
|
||||
});
|
||||
|
||||
it('it should set metadataFieldSuggestions to the right value', () => {
|
||||
|
@@ -8,6 +8,7 @@
|
||||
[ngClass]="{'is-invalid': !valid}"
|
||||
[dsDebounce]="debounceTime" (onDebounce)="find($event)"
|
||||
[placeholder]="placeholder"
|
||||
ng-model-options="{standalone: true}"
|
||||
autocomplete="off">
|
||||
<input type="submit" class="d-none"/>
|
||||
<small class="text-danger"
|
||||
|
@@ -37,7 +37,7 @@ export class FilterInputSuggestionsComponent extends InputSuggestionsComponent i
|
||||
|
||||
ngOnInit() {
|
||||
this.form = new FormGroup({
|
||||
metadataNameField: new FormControl('', {
|
||||
metadataNameField: new FormControl(this._value, {
|
||||
asyncValidators: [this.metadataFieldValidator.validate.bind(this.metadataFieldValidator)],
|
||||
validators: [Validators.required]
|
||||
})
|
||||
|
Reference in New Issue
Block a user