mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
fixed tests
This commit is contained in:
@@ -152,29 +152,33 @@ describe('ResourcePolicyCreateComponent test suite', () => {
|
|||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should init component properly', () => {
|
it('should init component properly', (done) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(compAsAny.targetResourceUUID).toBe('itemUUID');
|
expect(compAsAny.targetResourceUUID).toBe('itemUUID');
|
||||||
expect(compAsAny.targetResourceName).toBe('test item');
|
expect(compAsAny.targetResourceName).toBe('test item');
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect to authorizations page', () => {
|
it('should redirect to authorizations page', (done) => {
|
||||||
comp.redirectToAuthorizationsPage();
|
comp.redirectToAuthorizationsPage();
|
||||||
expect(compAsAny.router.navigate).toHaveBeenCalled();
|
expect(compAsAny.router.navigate).toHaveBeenCalled();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true when is Processing', () => {
|
it('should return true when is Processing', (done) => {
|
||||||
compAsAny.processing$.next(true);
|
compAsAny.processing$.next(true);
|
||||||
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
||||||
a: true
|
a: true
|
||||||
}));
|
}));
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false when is not Processing', () => {
|
it('should return false when is not Processing', (done) => {
|
||||||
compAsAny.processing$.next(false);
|
compAsAny.processing$.next(false);
|
||||||
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
||||||
a: false
|
a: false
|
||||||
}));
|
}));
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when target type is group', () => {
|
describe('when target type is group', () => {
|
||||||
|
@@ -137,28 +137,32 @@ describe('ResourcePolicyEditComponent test suite', () => {
|
|||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should init component properly', () => {
|
it('should init component properly', (done) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(compAsAny.resourcePolicy).toEqual(resourcePolicy);
|
expect(compAsAny.resourcePolicy).toEqual(resourcePolicy);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect to authorizations page', () => {
|
it('should redirect to authorizations page', (done) => {
|
||||||
comp.redirectToAuthorizationsPage();
|
comp.redirectToAuthorizationsPage();
|
||||||
expect(compAsAny.router.navigate).toHaveBeenCalled();
|
expect(compAsAny.router.navigate).toHaveBeenCalled();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true when is Processing', () => {
|
it('should return true when is Processing', (done) => {
|
||||||
compAsAny.processing$.next(true);
|
compAsAny.processing$.next(true);
|
||||||
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
||||||
a: true
|
a: true
|
||||||
}));
|
}));
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false when is not Processing', () => {
|
it('should return false when is not Processing', (done) => {
|
||||||
compAsAny.processing$.next(false);
|
compAsAny.processing$.next(false);
|
||||||
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
expect(comp.isProcessing()).toBeObservable(cold('a', {
|
||||||
a: false
|
a: false
|
||||||
}));
|
}));
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('', () => {
|
describe('', () => {
|
||||||
|
Reference in New Issue
Block a user