mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
32 lines
990 B
TypeScript
32 lines
990 B
TypeScript
import { first } from 'rxjs/operators';
|
|
|
|
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
|
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
|
|
import { WorkflowItemPageResolver } from './workflow-item-page.resolver';
|
|
|
|
describe('WorkflowItemPageResolver', () => {
|
|
describe('resolve', () => {
|
|
let resolver: any;
|
|
let wfiService: WorkflowItemDataService;
|
|
const uuid = '1234-65487-12354-1235';
|
|
|
|
beforeEach(() => {
|
|
wfiService = {
|
|
findById: (id: string) => createSuccessfulRemoteDataObject$({ id }),
|
|
} as any;
|
|
resolver = WorkflowItemPageResolver;
|
|
});
|
|
|
|
it('should resolve a workflow item with the correct id', (done) => {
|
|
resolver({ params: { id: uuid } } as any, undefined, wfiService)
|
|
.pipe(first())
|
|
.subscribe(
|
|
(resolved) => {
|
|
expect(resolved.payload.id).toEqual(uuid);
|
|
done();
|
|
},
|
|
);
|
|
});
|
|
});
|
|
});
|