mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 06:53:03 +00:00
23 lines
901 B
TypeScript
23 lines
901 B
TypeScript
import { Registration } from '../shared/registration.model';
|
|
import { RegistrationResponseParsingService } from './registration-response-parsing.service';
|
|
import { RegistrationSuccessResponse } from '../cache/response.models';
|
|
|
|
describe('RegistrationResponseParsingService', () => {
|
|
describe('parse', () => {
|
|
const registration = Object.assign(new Registration(), {email: 'test@email.org', token: 'test-token'});
|
|
const registrationResponseParsingService = new RegistrationResponseParsingService();
|
|
|
|
const data = {
|
|
payload: {email: 'test@email.org', token: 'test-token'},
|
|
statusCode: 200,
|
|
statusText: 'Success'
|
|
};
|
|
|
|
it('should parse a registration response', () => {
|
|
const expected = registrationResponseParsingService.parse({} as any, data);
|
|
|
|
expect(expected).toEqual(new RegistrationSuccessResponse(registration, 200, 'Success'));
|
|
});
|
|
});
|
|
});
|