Cache redesign part 1, and add support for alternative links

This commit is contained in:
Art Lowel
2020-12-11 14:18:44 +01:00
parent f4853972cc
commit 4e18fa35ca
522 changed files with 7537 additions and 6933 deletions

View File

@@ -22,6 +22,7 @@ import {
END_USER_AGREEMENT_METADATA_FIELD,
EndUserAgreementService
} from '../../core/end-user-agreement/end-user-agreement.service';
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
describe('CreateProfileComponent', () => {
let comp: CreateProfileComponent;
@@ -111,7 +112,7 @@ describe('CreateProfileComponent', () => {
notificationsService = new NotificationsServiceStub();
ePersonDataService = jasmine.createSpyObj('ePersonDataService', {
createEPersonForToken: observableOf(new RestResponse(true, 200, 'Success'))
createEPersonForToken: createSuccessfulRemoteDataObject$({})
});
store = jasmine.createSpyObj('store', {
@@ -218,7 +219,7 @@ describe('CreateProfileComponent', () => {
it('should submit an eperson for creation and stay on page on error', () => {
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(observableOf(new RestResponse(false, 500, 'Error')));
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Error', 500));
comp.firstName.patchValue('First');
comp.lastName.patchValue('Last');
@@ -236,7 +237,7 @@ describe('CreateProfileComponent', () => {
});
it('should submit not create an eperson when the user info form is invalid', () => {
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(observableOf(new RestResponse(false, 500, 'Error')));
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Error', 500));
comp.firstName.patchValue('');
comp.lastName.patchValue('Last');
@@ -251,7 +252,7 @@ describe('CreateProfileComponent', () => {
});
it('should submit not create an eperson when the password is invalid', () => {
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(observableOf(new RestResponse(false, 500, 'Error')));
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Error', 500));
comp.firstName.patchValue('First');
comp.lastName.patchValue('Last');