mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
97049: Fixing inconsistent tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { SearchHierarchyFilterComponent } from './search-hierarchy-filter.component';
|
import { SearchHierarchyFilterComponent } from './search-hierarchy-filter.component';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { DebugElement, EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { DebugElement, EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { VocabularyService } from '../../../../../core/submission/vocabularies/vocabulary.service';
|
import { VocabularyService } from '../../../../../core/submission/vocabularies/vocabulary.service';
|
||||||
@@ -89,12 +89,12 @@ describe('SearchHierarchyFilterComponent', () => {
|
|||||||
|
|
||||||
describe('if the vocabulary doesn\'t exist', () => {
|
describe('if the vocabulary doesn\'t exist', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
spyOn(vocabularyService, 'searchTopEntries').and.returnValue(observableOf(new RemoteData(
|
spyOn(vocabularyService, 'searchTopEntries').and.returnValue(observableOf(new RemoteData(
|
||||||
undefined, 0, 0, RequestEntryState.Error, undefined, undefined, 404
|
undefined, 0, 0, RequestEntryState.Error, undefined, undefined, 404
|
||||||
)));
|
)));
|
||||||
init();
|
init();
|
||||||
});
|
}));
|
||||||
|
|
||||||
it('should not show the vocabulary tree link', () => {
|
it('should not show the vocabulary tree link', () => {
|
||||||
expect(showVocabularyTreeLink).toBeNull();
|
expect(showVocabularyTreeLink).toBeNull();
|
||||||
@@ -103,12 +103,12 @@ describe('SearchHierarchyFilterComponent', () => {
|
|||||||
|
|
||||||
describe('if the vocabulary exists', () => {
|
describe('if the vocabulary exists', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
spyOn(vocabularyService, 'searchTopEntries').and.returnValue(observableOf(new RemoteData(
|
spyOn(vocabularyService, 'searchTopEntries').and.returnValue(observableOf(new RemoteData(
|
||||||
undefined, 0, 0, RequestEntryState.Success, undefined, buildPaginatedList(new PageInfo(), []), 200
|
undefined, 0, 0, RequestEntryState.Success, undefined, buildPaginatedList(new PageInfo(), []), 200
|
||||||
)));
|
)));
|
||||||
init();
|
init();
|
||||||
});
|
}));
|
||||||
|
|
||||||
it('should show the vocabulary tree link', () => {
|
it('should show the vocabulary tree link', () => {
|
||||||
expect(showVocabularyTreeLink).toBeTruthy();
|
expect(showVocabularyTreeLink).toBeTruthy();
|
||||||
|
Reference in New Issue
Block a user