Skip to content

Commit

Permalink
feat(hub-common): pass requestOptions to getUser call
Browse files Browse the repository at this point in the history
affects: @esri/hub-common
  • Loading branch information
rweber-esri committed May 2, 2024
1 parent 0305a1c commit 5f370b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function eventToSearchResult(
): Promise<IHubSearchResult> {
const ownerUser = await getUser({
username: event.creator.username,
authentication: options.authentication,
...options.requestOptions,
});
const result = {
access: event.access.toLowerCase() as AccessLevel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IHubSearchOptions } from "../../../../src/search/types/IHubSearchOption
describe("eventToSearchResult", () => {
const options = {
options: true,
authentication: { auth: true },
requestOptions: { requestOptions: true },
} as unknown as IHubSearchOptions;
const user = {
id: "user1",
Expand Down Expand Up @@ -41,7 +41,7 @@ describe("eventToSearchResult", () => {
expect(getUserSpy).toHaveBeenCalledTimes(1);
expect(getUserSpy).toHaveBeenCalledWith({
username: event.creator?.username,
authentication: options.authentication,
...options.requestOptions,
});
expect(result).toEqual({
access: event.access.toLowerCase() as AccessLevel,
Expand Down Expand Up @@ -75,7 +75,7 @@ describe("eventToSearchResult", () => {
expect(getUserSpy).toHaveBeenCalledTimes(1);
expect(getUserSpy).toHaveBeenCalledWith({
username: event.creator?.username,
authentication: options.authentication,
...options.requestOptions,
});
expect(result).toEqual({
access: event.access.toLowerCase() as AccessLevel,
Expand Down

0 comments on commit 5f370b3

Please sign in to comment.