Skip to content

Commit 910ab10

Browse files
[DSC-397] fix issue that lead to failing e2e
1 parent 7f7dba7 commit 910ab10

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

cypress/e2e/search-navbar.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const page = {
1515
}
1616
};
1717

18-
xdescribe('Search from Navigation Bar', () => {
18+
describe('Search from Navigation Bar', () => {
1919
// NOTE: these tests currently assume this query will return results!
2020
const query = TEST_SEARCH_TERM;
2121

src/app/core/browse/search-manager.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { map, switchMap } from 'rxjs/operators';
44
import { PaginatedList } from '../data/paginated-list.model';
55
import { RemoteData } from '../data/remote-data';
66
import { Item } from '../shared/item.model';
7-
import { getFirstSucceededRemoteData } from '../shared/operators';
7+
import { getFirstCompletedRemoteData } from '../shared/operators';
88
import { BrowseEntrySearchOptions } from './browse-entry-search-options.model';
99
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
1010
import { ItemDataService } from '../data/item-data.service';
@@ -107,8 +107,16 @@ export class SearchManager {
107107
.filter((item) => hasValue(item));
108108

109109
const uuidList = this.extractUUID(items, environment.followAuthorityMetadata);
110-
111-
return uuidList.length > 0 ? this.itemService.findAllById(uuidList).pipe(getFirstSucceededRemoteData()) : of(null);
110+
return uuidList.length > 0 ? this.itemService.findAllById(uuidList).pipe(
111+
getFirstCompletedRemoteData(),
112+
map(data => {
113+
if (data.hasSucceeded) {
114+
return of(data);
115+
} else {
116+
of(null);
117+
}
118+
})
119+
) : of(null);
112120
}
113121

114122
protected extractUUID(items: Item[], metadataToFollow: FollowAuthorityMetadata[]): string[] {

0 commit comments

Comments
 (0)