mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
fixing tests
This commit is contained in:
@@ -192,7 +192,7 @@ describe('DataService', () => {
|
||||
dso2.self = selfLink;
|
||||
dso2.metadata = [{ key: 'dc.title', value: name2 }];
|
||||
|
||||
spyOn(service, 'findByHref').and.returnValues(createSuccessfulRemoteDataObject$(dso));
|
||||
spyOn(service, 'findByHref').and.returnValue(createSuccessfulRemoteDataObject$(dso));
|
||||
spyOn(objectCache, 'addPatch');
|
||||
});
|
||||
|
||||
|
@@ -123,8 +123,8 @@ describe('RelationshipService', () => {
|
||||
it('should clear the related items their cache', () => {
|
||||
expect(objectCache.remove).toHaveBeenCalledWith(relatedItem1.self);
|
||||
expect(objectCache.remove).toHaveBeenCalledWith(item.self);
|
||||
expect(requestService.removeByHrefSubstring).toHaveBeenCalledWith(relatedItem1.self);
|
||||
expect(requestService.removeByHrefSubstring).toHaveBeenCalledWith(item.self);
|
||||
expect(requestService.removeByHrefSubstring).toHaveBeenCalledWith(relatedItem1.uuid);
|
||||
expect(requestService.removeByHrefSubstring).toHaveBeenCalledWith(item.uuid);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -150,7 +150,7 @@ export class RelationshipService extends DataService<Relationship> {
|
||||
this.requestService.removeByHrefSubstring(item.uuid);
|
||||
combineLatest(
|
||||
this.objectCache.hasBySelfLinkObservable(item.self),
|
||||
this.requestService.hasByHrefObservable(item.self)
|
||||
this.requestService.hasByHrefObservable(item.uuid)
|
||||
).pipe(
|
||||
filter(([existsInOC, existsInRC]) => !existsInOC && !existsInRC),
|
||||
take(1),
|
||||
|
@@ -16,7 +16,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs/internal/observable/of';
|
||||
|
||||
describe('ItemSelectComponent', () => {
|
||||
fdescribe('ItemSelectComponent', () => {
|
||||
let comp: ItemSelectComponent;
|
||||
let fixture: ComponentFixture<ItemSelectComponent>;
|
||||
let objectSelectService: ObjectSelectService;
|
||||
|
@@ -4,7 +4,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { Params } from '@angular/router';
|
||||
import { Params, Router } from '@angular/router';
|
||||
import { SearchLabelComponent } from './search-label.component';
|
||||
import { ObjectKeysPipe } from '../../../utils/object-keys-pipe';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../+my-dspace-page/my-dspace-page.component';
|
||||
@@ -39,7 +39,8 @@ describe('SearchLabelComponent', () => {
|
||||
declarations: [SearchLabelComponent, ObjectKeysPipe],
|
||||
providers: [
|
||||
{ provide: SearchService, useValue: new SearchServiceStub(searchLink) },
|
||||
{ provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }
|
||||
{ provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() },
|
||||
{ provide: Router, useValue: {}}
|
||||
// { provide: SearchConfigurationService, useValue: {getCurrentFrontendFilters : () => observableOf({})} }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
|
Reference in New Issue
Block a user