mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
commit before merge
This commit is contained in:
@@ -5,7 +5,7 @@ import { Store } from '@ngrx/store';
|
||||
import { cold, hot } from 'jasmine-marbles';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of as observableOf, throwError as observableThrow } from 'rxjs';
|
||||
|
||||
import { AuthEffects } from './auth.effects';
|
||||
import {
|
||||
@@ -72,7 +72,7 @@ describe('AuthEffects', () => {
|
||||
|
||||
describe('when credentials are wrong', () => {
|
||||
it('should return a AUTHENTICATE_ERROR action in response to a AUTHENTICATE action', () => {
|
||||
spyOn((authEffects as any).authService, 'authenticate').and.returnValue(Observable.throw(new Error('Message Error test')));
|
||||
spyOn((authEffects as any).authService, 'authenticate').and.returnValue(observableThrow(new Error('Message Error test')));
|
||||
|
||||
actions = hot('--a-', {
|
||||
a: {
|
||||
@@ -113,7 +113,7 @@ describe('AuthEffects', () => {
|
||||
|
||||
describe('when token is not valid', () => {
|
||||
it('should return a AUTHENTICATED_ERROR action in response to a AUTHENTICATED action', () => {
|
||||
spyOn((authEffects as any).authService, 'authenticatedUser').and.returnValue(Observable.throw(new Error('Message Error test')));
|
||||
spyOn((authEffects as any).authService, 'authenticatedUser').and.returnValue(observableThrow(new Error('Message Error test')));
|
||||
|
||||
actions = hot('--a-', {a: {type: AuthActionTypes.AUTHENTICATED, payload: token}});
|
||||
|
||||
@@ -165,7 +165,7 @@ describe('AuthEffects', () => {
|
||||
|
||||
describe('when refresh token failed', () => {
|
||||
it('should return a REFRESH_TOKEN_ERROR action in response to a REFRESH_TOKEN action', () => {
|
||||
spyOn((authEffects as any).authService, 'refreshAuthenticationToken').and.returnValue(Observable.throw(''));
|
||||
spyOn((authEffects as any).authService, 'refreshAuthenticationToken').and.returnValue(observableThrow(''));
|
||||
|
||||
actions = hot('--a-', {a: {type: AuthActionTypes.REFRESH_TOKEN, payload: token}});
|
||||
|
||||
@@ -191,7 +191,7 @@ describe('AuthEffects', () => {
|
||||
|
||||
describe('when refresh token failed', () => {
|
||||
it('should return a REFRESH_TOKEN_ERROR action in response to a LOG_OUT action', () => {
|
||||
spyOn((authEffects as any).authService, 'logout').and.returnValue(Observable.throw(new Error('Message Error test')));
|
||||
spyOn((authEffects as any).authService, 'logout').and.returnValue(observableThrow(new Error('Message Error test')));
|
||||
|
||||
actions = hot('--a-', {a: {type: AuthActionTypes.LOG_OUT, payload: token}});
|
||||
|
||||
|
@@ -191,7 +191,7 @@ describe('Dynamic Lookup component', () => {
|
||||
const btnEl = de[0].nativeElement;
|
||||
const selectedValue = Object.assign(new AuthorityValueModel(), {id: 1, display: 'one', value: 1});
|
||||
spyOn(lookupComp.change, 'emit');
|
||||
|
||||
console.log("debugger");
|
||||
lookupComp.firstInputValue = 'test';
|
||||
lookupFixture.detectChanges();
|
||||
btnEl.click();
|
||||
|
@@ -119,7 +119,7 @@ describe('DsDynamicTagComponent test suite', () => {
|
||||
}));
|
||||
});
|
||||
|
||||
describe('when authorityOptions are setted', () => {
|
||||
describe('when authorityOptions are set', () => {
|
||||
describe('and init model value is empty', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -229,7 +229,7 @@ describe('DsDynamicTagComponent test suite', () => {
|
||||
|
||||
});
|
||||
|
||||
describe('when authorityOptions are not setted', () => {
|
||||
describe('when authorityOptions are not set', () => {
|
||||
describe('and init model value is empty', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
|
@@ -13,13 +13,10 @@ import {
|
||||
DynamicColorPickerModel,
|
||||
DynamicDatePickerModel,
|
||||
DynamicEditorModel,
|
||||
DynamicFileUploadModel, DynamicFormArrayGroupModel,
|
||||
DynamicFileUploadModel,
|
||||
DynamicFormArrayModel,
|
||||
DynamicFormControlModel,
|
||||
// DynamicFormControlValue,
|
||||
DynamicFormGroupModel,
|
||||
DynamicFormService,
|
||||
DynamicFormValidationService,
|
||||
DynamicFormGroupModel, DynamicFormValidationService,
|
||||
DynamicFormValueControlModel,
|
||||
DynamicInputModel,
|
||||
DynamicRadioGroupModel,
|
||||
@@ -41,7 +38,10 @@ import { DynamicTypeaheadModel } from './ds-dynamic-form-ui/models/typeahead/dyn
|
||||
import { DynamicListRadioGroupModel } from './ds-dynamic-form-ui/models/list/dynamic-list-radio-group.model';
|
||||
import { AuthorityOptions } from '../../../core/integration/models/authority-options.model';
|
||||
import { FormFieldModel } from './models/form-field.model';
|
||||
import { FormRowModel, SubmissionFormsModel } from '../../../core/shared/config/config-submission-forms.model';
|
||||
import {
|
||||
FormRowModel,
|
||||
SubmissionFormsModel
|
||||
} from '../../../core/shared/config/config-submission-forms.model';
|
||||
import { FormBuilderService } from './form-builder.service';
|
||||
import { DynamicRowGroupModel } from './ds-dynamic-form-ui/models/ds-dynamic-row-group-model';
|
||||
import { DsDynamicInputModel } from './ds-dynamic-form-ui/models/ds-dynamic-input.model';
|
||||
@@ -49,7 +49,6 @@ import { FormFieldMetadataValueObject } from './models/form-field-metadata-value
|
||||
import { DynamicConcatModel } from './ds-dynamic-form-ui/models/ds-dynamic-concat.model';
|
||||
import { DynamicLookupNameModel } from './ds-dynamic-form-ui/models/lookup/dynamic-lookup-name.model';
|
||||
import { DynamicRowArrayModel } from './ds-dynamic-form-ui/models/ds-dynamic-row-array-model';
|
||||
import { getMockFormBuilderService } from '../../mocks/mock-form-builder-service';
|
||||
|
||||
describe('FormBuilderService test suite', () => {
|
||||
|
||||
@@ -70,7 +69,8 @@ describe('FormBuilderService test suite', () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ReactiveFormsModule],
|
||||
providers: [
|
||||
{provide: FormBuilderService, useValue: getMockFormBuilderService()},
|
||||
{provide: FormBuilderService, useClass: FormBuilderService},
|
||||
{provide: DynamicFormValidationService, useValue: {}},
|
||||
{provide: NG_VALIDATORS, useValue: testValidator, multi: true},
|
||||
{provide: NG_ASYNC_VALIDATORS, useValue: testAsyncValidator, multi: true}
|
||||
]
|
||||
|
Reference in New Issue
Block a user