mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
finished tests
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { first } from 'rxjs/operators';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { WorkflowItemPageResolver } from './workflow-item-page.resolver';
|
||||
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
||||
|
||||
describe('WorkflowItemPageResolver', () => {
|
||||
describe('resolve', () => {
|
||||
let resolver: WorkflowItemPageResolver;
|
||||
let wfiService: WorkflowItemDataService;
|
||||
const uuid = '1234-65487-12354-1235';
|
||||
|
||||
beforeEach(() => {
|
||||
wfiService = {
|
||||
findById: (id: string) => observableOf({ payload: { id }, hasSucceeded: true }) as any
|
||||
} as any;
|
||||
resolver = new WorkflowItemPageResolver(wfiService);
|
||||
});
|
||||
|
||||
it('should resolve a workflow item with the correct id', () => {
|
||||
resolver.resolve({ params: { id: uuid } } as any, undefined)
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(resolved) => {
|
||||
expect(resolved.payload.id).toEqual(uuid);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user