Fixed AOT build after upgrade to angular 7

This commit is contained in:
Giuseppe Digilio
2019-12-19 13:55:02 +01:00
parent c9987e3451
commit 2022268ab0
14 changed files with 40 additions and 49 deletions

View File

@@ -1,7 +1,6 @@
import { MetadataRegistryComponent } from './metadata-registry.component'; import { MetadataRegistryComponent } from './metadata-registry.component';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { RemoteData } from '../../../core/data/remote-data';
import { PaginatedList } from '../../../core/data/paginated-list'; import { PaginatedList } from '../../../core/data/paginated-list';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
@@ -18,6 +17,7 @@ import { NotificationsService } from '../../../shared/notifications/notification
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub';
import { RestResponse } from '../../../core/cache/response.models'; import { RestResponse } from '../../../core/cache/response.models';
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
describe('MetadataRegistryComponent', () => { describe('MetadataRegistryComponent', () => {
let comp: MetadataRegistryComponent; let comp: MetadataRegistryComponent;
@@ -101,12 +101,12 @@ describe('MetadataRegistryComponent', () => {
it('should start editing the selected schema', async(() => { it('should start editing the selected schema', async(() => {
fixture.whenStable().then(() => { fixture.whenStable().then(() => {
expect(registryService.editMetadataSchema).toHaveBeenCalledWith(mockSchemasList[0]); expect(registryService.editMetadataSchema).toHaveBeenCalledWith(mockSchemasList[0] as MetadataSchema);
}); });
})); }));
it('should cancel editing the selected schema when clicked again', async(() => { it('should cancel editing the selected schema when clicked again', async(() => {
spyOn(registryService, 'getActiveMetadataSchema').and.returnValue(observableOf(mockSchemasList[0])); spyOn(registryService, 'getActiveMetadataSchema').and.returnValue(observableOf(mockSchemasList[0] as MetadataSchema));
spyOn(registryService, 'cancelEditMetadataSchema'); spyOn(registryService, 'cancelEditMetadataSchema');
row.click(); row.click();
fixture.detectChanges(); fixture.detectChanges();
@@ -121,7 +121,7 @@ describe('MetadataRegistryComponent', () => {
beforeEach(() => { beforeEach(() => {
spyOn(registryService, 'deleteMetadataSchema').and.callThrough(); spyOn(registryService, 'deleteMetadataSchema').and.callThrough();
spyOn(registryService, 'getSelectedMetadataSchemas').and.returnValue(observableOf(selectedSchemas)); spyOn(registryService, 'getSelectedMetadataSchemas').and.returnValue(observableOf(selectedSchemas as MetadataSchema[]));
comp.deleteSchemas(); comp.deleteSchemas();
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@@ -1,7 +1,6 @@
import { MetadataSchemaComponent } from './metadata-schema.component'; import { MetadataSchemaComponent } from './metadata-schema.component';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { RemoteData } from '../../../core/data/remote-data';
import { PaginatedList } from '../../../core/data/paginated-list'; import { PaginatedList } from '../../../core/data/paginated-list';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
@@ -22,6 +21,7 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications-
import { RestResponse } from '../../../core/cache/response.models'; import { RestResponse } from '../../../core/cache/response.models';
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
import { MetadataField } from '../../../core/metadata/metadata-field.model';
describe('MetadataSchemaComponent', () => { describe('MetadataSchemaComponent', () => {
let comp: MetadataSchemaComponent; let comp: MetadataSchemaComponent;
@@ -152,12 +152,12 @@ describe('MetadataSchemaComponent', () => {
it('should start editing the selected field', async(() => { it('should start editing the selected field', async(() => {
fixture.whenStable().then(() => { fixture.whenStable().then(() => {
expect(registryService.editMetadataField).toHaveBeenCalledWith(mockFieldsList[2]); expect(registryService.editMetadataField).toHaveBeenCalledWith(mockFieldsList[2] as MetadataField);
}); });
})); }));
it('should cancel editing the selected field when clicked again', async(() => { it('should cancel editing the selected field when clicked again', async(() => {
spyOn(registryService, 'getActiveMetadataField').and.returnValue(observableOf(mockFieldsList[2])); spyOn(registryService, 'getActiveMetadataField').and.returnValue(observableOf(mockFieldsList[2] as MetadataField));
spyOn(registryService, 'cancelEditMetadataField'); spyOn(registryService, 'cancelEditMetadataField');
row.click(); row.click();
fixture.detectChanges(); fixture.detectChanges();
@@ -172,7 +172,7 @@ describe('MetadataSchemaComponent', () => {
beforeEach(() => { beforeEach(() => {
spyOn(registryService, 'deleteMetadataField').and.callThrough(); spyOn(registryService, 'deleteMetadataField').and.callThrough();
spyOn(registryService, 'getSelectedMetadataFields').and.returnValue(observableOf(selectedFields)); spyOn(registryService, 'getSelectedMetadataFields').and.returnValue(observableOf(selectedFields as MetadataField[]));
comp.deleteFields(); comp.deleteFields();
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@@ -3,7 +3,7 @@ import { RequestEntry } from './request.reducer';
import { RestResponse } from '../cache/response.models'; import { RestResponse } from '../cache/response.models';
import { Observable, of as observableOf } from 'rxjs'; import { Observable, of as observableOf } from 'rxjs';
import { Action, Store } from '@ngrx/store'; import { Action, Store } from '@ngrx/store';
import { CoreState } from '../core.reducers'; import { AppState } from '../../app.reducer';
import { ObjectCacheService } from '../cache/object-cache.service'; import { ObjectCacheService } from '../cache/object-cache.service';
import { cold, getTestScheduler, hot } from 'jasmine-marbles'; import { cold, getTestScheduler, hot } from 'jasmine-marbles';
import { HALEndpointService } from '../shared/hal-endpoint.service'; import { HALEndpointService } from '../shared/hal-endpoint.service';
@@ -36,7 +36,7 @@ describe('BitstreamFormatDataService', () => {
dispatch(action: Action) { dispatch(action: Action) {
// Do Nothing // Do Nothing
} }
} as Store<CoreState>; } as Store<AppState>;
const objectCache = {} as ObjectCacheService; const objectCache = {} as ObjectCacheService;
const halEndpointService = { const halEndpointService = {

View File

@@ -6,22 +6,14 @@ import { CoreState } from '../core.reducers';
import { ItemDataService } from './item-data.service'; import { ItemDataService } from './item-data.service';
import { RequestService } from './request.service'; import { RequestService } from './request.service';
import { HALEndpointService } from '../shared/hal-endpoint.service'; import { HALEndpointService } from '../shared/hal-endpoint.service';
import { import { DeleteRequest, FindListOptions, PostRequest, RestRequest } from './request.models';
DeleteRequest,
FindListOptions,
GetRequest,
MappedCollectionsRequest,
PostRequest,
RestRequest
} from './request.models';
import { ObjectCacheService } from '../cache/object-cache.service'; import { ObjectCacheService } from '../cache/object-cache.service';
import { Observable } from 'rxjs'; import { Observable, of as observableOf } from 'rxjs';
import { RestResponse } from '../cache/response.models'; import { RestResponse } from '../cache/response.models';
import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsService } from '../../shared/notifications/notifications.service';
import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service'; import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { RequestEntry } from './request.reducer'; import { RequestEntry } from './request.reducer';
import { of as observableOf } from 'rxjs';
import { getMockRequestService } from '../../shared/mocks/mock-request.service'; import { getMockRequestService } from '../../shared/mocks/mock-request.service';
describe('ItemDataService', () => { describe('ItemDataService', () => {
@@ -184,7 +176,7 @@ describe('ItemDataService', () => {
}); });
it('should configure a DELETE request', () => { it('should configure a DELETE request', () => {
result.subscribe(() => expect(requestService.configure).toHaveBeenCalledWith(jasmine.any(DeleteRequest), undefined)); result.subscribe(() => expect(requestService.configure).toHaveBeenCalledWith(jasmine.any(DeleteRequest)));
}); });
}); });
@@ -198,7 +190,7 @@ describe('ItemDataService', () => {
}); });
it('should configure a POST request', () => { it('should configure a POST request', () => {
result.subscribe(() => expect(requestService.configure).toHaveBeenCalledWith(jasmine.any(PostRequest), undefined)); result.subscribe(() => expect(requestService.configure).toHaveBeenCalledWith(jasmine.any(PostRequest)));
}); });
}); });

View File

@@ -21,6 +21,7 @@ import {
} from './request.models'; } from './request.models';
import { RequestService } from './request.service'; import { RequestService } from './request.service';
import { TestScheduler } from 'rxjs/testing'; import { TestScheduler } from 'rxjs/testing';
import { RequestEntry } from './request.reducer';
describe('RequestService', () => { describe('RequestService', () => {
let scheduler: TestScheduler; let scheduler: TestScheduler;
@@ -107,7 +108,7 @@ describe('RequestService', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getByHref').and.returnValue(observableOf({ spyOn(service, 'getByHref').and.returnValue(observableOf({
completed: false completed: false
})) } as RequestEntry))
}); });
it('should return true', () => { it('should return true', () => {
@@ -122,7 +123,7 @@ describe('RequestService', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getByHref').and.returnValues(observableOf({ spyOn(service, 'getByHref').and.returnValues(observableOf({
completed: true completed: true
})); } as RequestEntry));
}); });
it('should return false', () => { it('should return false', () => {
@@ -432,7 +433,7 @@ describe('RequestService', () => {
let valid; let valid;
const requestEntry = { completed: false }; const requestEntry = { completed: false };
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry)); spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry as RequestEntry));
valid = serviceAsAny.isValid(requestEntry); valid = serviceAsAny.isValid(requestEntry);
}); });
it('return an observable emitting false', () => { it('return an observable emitting false', () => {
@@ -444,7 +445,7 @@ describe('RequestService', () => {
let valid; let valid;
const requestEntry = { completed: true, response: { isSuccessful: false } }; const requestEntry = { completed: true, response: { isSuccessful: false } };
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry)); spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry as RequestEntry));
valid = serviceAsAny.isValid(requestEntry); valid = serviceAsAny.isValid(requestEntry);
}); });
it('return an observable emitting false', () => { it('return an observable emitting false', () => {
@@ -470,7 +471,7 @@ describe('RequestService', () => {
beforeEach(() => { beforeEach(() => {
spyOn(Date.prototype, 'getTime').and.returnValue(now); spyOn(Date.prototype, 'getTime').and.returnValue(now);
spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry)); spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry as RequestEntry));
valid = serviceAsAny.isValid(requestEntry); valid = serviceAsAny.isValid(requestEntry);
}); });
@@ -497,7 +498,7 @@ describe('RequestService', () => {
}; };
beforeEach(() => { beforeEach(() => {
spyOn(Date.prototype, 'getTime').and.returnValue(now); spyOn(Date.prototype, 'getTime').and.returnValue(now);
spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry)); spyOn(service, 'getByUUID').and.returnValue(observableOf(requestEntry as RequestEntry));
valid = serviceAsAny.isValid(requestEntry); valid = serviceAsAny.isValid(requestEntry);
}); });

View File

@@ -3,11 +3,9 @@ import { TranslateModule } from '@ngx-translate/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core'; import { NO_ERRORS_SCHEMA } from '@angular/core';
import { DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core'; import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core';
import { FormControl, FormGroup } from '@angular/forms'; import { FormControl, FormGroup } from '@angular/forms';
import { DynamicFormControlModel } from '@ng-dynamic-forms/core/src/model/dynamic-form-control.model';
import { Community } from '../../../core/shared/community.model'; import { Community } from '../../../core/shared/community.model';
import { ResourceType } from '../../../core/shared/resource-type';
import { ComColFormComponent } from './comcol-form.component'; import { ComColFormComponent } from './comcol-form.component';
import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model';
import { hasValue } from '../../empty.util'; import { hasValue } from '../../empty.util';

View File

@@ -12,6 +12,7 @@ import {
ExpandMenuAction, ExpandMenuPreviewAction, HideMenuAction, ExpandMenuAction, ExpandMenuPreviewAction, HideMenuAction,
RemoveMenuSectionAction, ShowMenuAction, ToggleActiveMenuSectionAction, ToggleMenuAction RemoveMenuSectionAction, ShowMenuAction, ToggleActiveMenuSectionAction, ToggleMenuAction
} from './menu.actions'; } from './menu.actions';
import { MenuSection } from './menu.reducer';
describe('MenuService', () => { describe('MenuService', () => {
let service: MenuService; let service: MenuService;
@@ -125,7 +126,7 @@ describe('MenuService', () => {
describe('when the subsection list is not empty', () => { describe('when the subsection list is not empty', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getMenuSection').and.returnValue(observableOf(visibleSection1)); spyOn(service, 'getMenuSection').and.returnValue(observableOf(visibleSection1 as MenuSection));
selectSpy.and.callFake(() => { selectSpy.and.callFake(() => {
return () => { return () => {
return () => hot('a', { return () => hot('a', {
@@ -283,7 +284,7 @@ describe('MenuService', () => {
describe('isSectionActive', () => { describe('isSectionActive', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getMenuSection').and.returnValue(observableOf(visibleSection1)); spyOn(service, 'getMenuSection').and.returnValue(observableOf(visibleSection1 as MenuSection));
}); });
it('should return false when the section is not active', () => { it('should return false when the section is not active', () => {
@@ -298,7 +299,7 @@ describe('MenuService', () => {
describe('isSectionVisible', () => { describe('isSectionVisible', () => {
beforeEach(() => { beforeEach(() => {
spyOn(service, 'getMenuSection').and.returnValue(observableOf(hiddenSection3)); spyOn(service, 'getMenuSection').and.returnValue(observableOf(hiddenSection3 as MenuSection));
}); });
it('should return false when the section is hidden', () => { it('should return false when the section is hidden', () => {

View File

@@ -88,7 +88,7 @@ describe('ItemDetailPreviewComponent', () => {
component.object = { hitHighlights: {} } as any; component.object = { hitHighlights: {} } as any;
component.item = mockItem; component.item = mockItem;
component.separator = ', '; component.separator = ', ';
spyOn(component.item, 'getFiles').and.returnValue(mockItem.bundles); spyOn(component.item, 'getFiles').and.returnValue(mockItem.bundles as any);
fixture.detectChanges(); fixture.detectChanges();
})); }));

View File

@@ -4,7 +4,6 @@ import { By } from '@angular/platform-browser';
import { ObjectDetailComponent } from './object-detail.component'; import { ObjectDetailComponent } from './object-detail.component';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { MockTranslateLoader } from '../mocks/mock-translate-loader'; import { MockTranslateLoader } from '../mocks/mock-translate-loader';
import { RemoteData } from '../../core/data/remote-data';
import { PaginatedList } from '../../core/data/paginated-list'; import { PaginatedList } from '../../core/data/paginated-list';
import { PageInfo } from '../../core/shared/page-info.model'; import { PageInfo } from '../../core/shared/page-info.model';
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NoopAnimationsModule } from '@angular/platform-browser/animations';
@@ -14,7 +13,7 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model';
describe('ObjectDetailComponent', () => { describe('ObjectDetailComponent', () => {
let comp: ObjectDetailComponent; let comp: ObjectDetailComponent;
let fixture: ComponentFixture<ObjectDetailComponent>; let fixture: ComponentFixture<ObjectDetailComponent>;
const testEvent = {test: 'test'}; const testEvent: any = {test: 'test'};
const testObjects = [ const testObjects = [
Object.assign (new DSpaceObject(), { one: 1 }), Object.assign (new DSpaceObject(), { one: 1 }),
@@ -28,7 +27,7 @@ describe('ObjectDetailComponent', () => {
Object.assign (new DSpaceObject(), { nine: 9 }), Object.assign (new DSpaceObject(), { nine: 9 }),
Object.assign (new DSpaceObject(), { ten: 10 }), Object.assign (new DSpaceObject(), { ten: 10 }),
]; ];
const pageInfo = Object.assign(new PageInfo(), {elementsPerPage: 1, totalElements: 10, totalPages: 10, currentPage: 1}) const pageInfo = Object.assign(new PageInfo(), {elementsPerPage: 1, totalElements: 10, totalPages: 10, currentPage: 1});
const mockRD = createSuccessfulRemoteDataObject(new PaginatedList(pageInfo, testObjects)); const mockRD = createSuccessfulRemoteDataObject(new PaginatedList(pageInfo, testObjects));
beforeEach(async(() => { beforeEach(async(() => {

View File

@@ -6,7 +6,7 @@ import { By } from '@angular/platform-browser';
describe('ObjectListComponent', () => { describe('ObjectListComponent', () => {
let comp: ObjectListComponent; let comp: ObjectListComponent;
let fixture: ComponentFixture<ObjectListComponent>; let fixture: ComponentFixture<ObjectListComponent>;
const testEvent = {test: 'test'}; const testEvent: any = {test: 'test'};
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({

View File

@@ -3,8 +3,8 @@ import { CommonModule } from '@angular/common';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core'; import { NO_ERRORS_SCHEMA } from '@angular/core';
import { of as observableOf } from 'rxjs/internal/observable/of'; import { of as observableOf } from 'rxjs/internal/observable/of';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { StartsWithDateComponent } from './starts-with-date.component'; import { StartsWithDateComponent } from './starts-with-date.component';
@@ -159,7 +159,7 @@ describe('StartsWithDateComponent', () => {
describe('when filling in the input form', () => { describe('when filling in the input form', () => {
let form; let form;
const expectedValue = '2015'; const expectedValue = '2015';
const extras = { const extras: NavigationExtras = {
queryParams: Object.assign({ startsWith: expectedValue }), queryParams: Object.assign({ startsWith: expectedValue }),
queryParamsHandling: 'merge' queryParamsHandling: 'merge'
}; };

View File

@@ -1,5 +1,5 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
@@ -66,7 +66,7 @@ describe('StartsWithTextComponent', () => {
let select; let select;
let input; let input;
const expectedValue = '0'; const expectedValue = '0';
const extras = { const extras: NavigationExtras = {
queryParams: Object.assign({ startsWith: expectedValue }), queryParams: Object.assign({ startsWith: expectedValue }),
queryParamsHandling: 'merge' queryParamsHandling: 'merge'
}; };
@@ -96,7 +96,7 @@ describe('StartsWithTextComponent', () => {
let select; let select;
let input; let input;
const expectedValue = options[1]; const expectedValue = options[1];
const extras = { const extras: NavigationExtras = {
queryParams: Object.assign({ startsWith: expectedValue }), queryParams: Object.assign({ startsWith: expectedValue }),
queryParamsHandling: 'merge' queryParamsHandling: 'merge'
}; };
@@ -126,7 +126,7 @@ describe('StartsWithTextComponent', () => {
let optionLink; let optionLink;
let input; let input;
const expectedValue = options[1]; const expectedValue = options[1];
const extras = { const extras: NavigationExtras = {
queryParams: Object.assign({ startsWith: expectedValue }), queryParams: Object.assign({ startsWith: expectedValue }),
queryParamsHandling: 'merge' queryParamsHandling: 'merge'
}; };
@@ -154,7 +154,7 @@ describe('StartsWithTextComponent', () => {
describe('when filling in the input form', () => { describe('when filling in the input form', () => {
let form; let form;
const expectedValue = 'A'; const expectedValue = 'A';
const extras = { const extras: NavigationExtras = {
queryParams: Object.assign({ startsWith: expectedValue }), queryParams: Object.assign({ startsWith: expectedValue }),
queryParamsHandling: 'merge' queryParamsHandling: 'merge'
}; };

View File

@@ -20,7 +20,7 @@ describe('Angulartics2DSpace', () => {
it('should use the statisticsService', () => { it('should use the statisticsService', () => {
provider.startTracking(); provider.startTracking();
expect(statisticsService.trackViewEvent).toHaveBeenCalledWith('mock-object'); expect(statisticsService.trackViewEvent).toHaveBeenCalledWith('mock-object' as any);
}); });
}); });

View File

@@ -342,7 +342,7 @@ describe('SubmissionFormCollectionComponent Component', () => {
fixture.detectChanges(); fixture.detectChanges();
expect(comp.searchField.reset).toHaveBeenCalled(); expect(comp.searchField.reset).toHaveBeenCalled();
expect(comp.collectionChange.emit).toHaveBeenCalledWith(submissionRestResponse[0]); expect(comp.collectionChange.emit).toHaveBeenCalledWith(submissionRestResponse[0] as any);
expect(submissionServiceStub.changeSubmissionCollection).toHaveBeenCalled(); expect(submissionServiceStub.changeSubmissionCollection).toHaveBeenCalled();
expect(comp.selectedCollectionId).toBe(mockCollectionList[1].collection.id); expect(comp.selectedCollectionId).toBe(mockCollectionList[1].collection.id);
expect(comp.selectedCollectionName$).toBeObservable(cold('(a|)', { expect(comp.selectedCollectionName$).toBeObservable(cold('(a|)', {