Skip to content

Commit

Permalink
97257 Processing review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Pauwels committed Jan 3, 2023
1 parent b372777 commit 7982259
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,31 @@ describe('EditableItemSelectorComponent', () => {
['1','2','3'].map(createFindItemsResult),
['4','5','6'].map(createFindItemsResult),
];
const itemDataService = {
findItemsWithEdit: (query: string, options: FindListOptions,
useCachedVersionIfAvailable = true, reRequestOnStale = true) => {
return createSuccessfulRemoteDataObject$(createPaginatedList(
query.startsWith('search.resourceid') ? [currentResult] : pages[options.currentPage - 1]
));
}
};

/*
beforeEach(() => {
dsoService = {
findByIdAndIDType: jasmine.createSpy('findByIdAndIDType').and.returnValue(observableOf({ hasFailed: false,
hasSucceeded: true }))
};
guard = new LookupGuard(dsoService);
});
*/
let itemDataService;
let notificationsService: NotificationsService;

beforeEach(waitForAsync( () => {
notificationsService = jasmine.createSpyObj('notificationsService', ['error']);
itemDataService = {
findItemsWithEdit: jasmine.createSpy('findItemsWithEdit').and.callFake(
(query: string, options: FindListOptions,
useCachedVersionIfAvailable = true, reRequestOnStale = true) => {
return createSuccessfulRemoteDataObject$(createPaginatedList(
query.startsWith('search.resourceid') ? [currentResult] : pages[options.currentPage - 1]
));
}
)
};
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot()],
declarations: [EditableItemSelectorComponent],
Expand Down Expand Up @@ -109,7 +122,7 @@ describe('EditableItemSelectorComponent', () => {

describe('when search returns an error', () => {
beforeEach(() => {
spyOn(itemDataService, 'findItemsWithEdit').and.returnValue(createFailedRemoteDataObject$());
itemDataService.findItemsWithEdit.and.returnValue(createFailedRemoteDataObject$());
component.ngOnInit();
});

Expand Down

0 comments on commit 7982259

Please sign in to comment.