Skip to content

Commit

Permalink
feat(hub-common): add cast statements when translating events 3 locat…
Browse files Browse the repository at this point in the history
…ion objects to IHubLocation obj

affects: @esri/hub-common

ISSUES CLOSED: 11024
  • Loading branch information
rweber-esri committed Sep 25, 2024
1 parent 1e2d039 commit ad7e2d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IHubLocation } from "../../../src/core/types/IHubLocation";
import { getLocationFromEvent } from "../../../src/events/_internal/getLocationFromEvent";
import {
EventLocationType,
Expand Down Expand Up @@ -76,7 +77,7 @@ describe("getLocationFromEvent", () => {
spatialReference: Object({ wkid: 4326 }),
},
],
});
} as unknown as IHubLocation);
});
it('should return a location object of type "custom" with a point', () => {
const event: Partial<IEvent> = {
Expand Down Expand Up @@ -131,7 +132,7 @@ describe("getLocationFromEvent", () => {
spatialReference: Object({ wkid: 4326 }),
},
],
});
} as unknown as IHubLocation);
});
it('should return a location object of type "custom" with a polyline', () => {
const event: Partial<IEvent> = {
Expand Down Expand Up @@ -202,7 +203,7 @@ describe("getLocationFromEvent", () => {
spatialReference: { wkid: 4326 },
},
],
});
} as unknown as IHubLocation);
});
it('should return a location object of type "custom" with a polygon', () => {
const event: Partial<IEvent> = {
Expand Down Expand Up @@ -269,7 +270,7 @@ describe("getLocationFromEvent", () => {
spatialReference: { wkid: 4326 },
},
],
});
} as unknown as IHubLocation);
});
it('should return a location object of type "custom" with a extent', () => {
const event: Partial<IEvent> = {
Expand Down Expand Up @@ -328,6 +329,6 @@ describe("getLocationFromEvent", () => {
spatialReference: { wkid: 4326 },
},
],
});
} as unknown as IHubLocation);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe("eventToSearchResult", () => {
spatialReference: Object({ wkid: 4326 }),
},
],
};
} as unknown as IHubLocation;
getUserSpy = spyOn(restPortal, "getUser").and.returnValue(
Promise.resolve(user)
);
Expand Down

0 comments on commit ad7e2d0

Please sign in to comment.