From 083456f42c8a8a3a27e0e6503df236d33c0bcd7a Mon Sep 17 00:00:00 2001 From: Philip Garrison Date: Thu, 19 Dec 2024 15:56:02 -0800 Subject: [PATCH] 368 Test for new HTTPAnnotationService special case --- packages/core/entity/Annotation/mocks.ts | 6 ++++++ .../test/HttpAnnotationService.test.ts | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/core/entity/Annotation/mocks.ts b/packages/core/entity/Annotation/mocks.ts index 4c85c304f..46064f073 100644 --- a/packages/core/entity/Annotation/mocks.ts +++ b/packages/core/entity/Annotation/mocks.ts @@ -29,4 +29,10 @@ export const annotationsJson = [ description: "Imaging objective", type: "Number", }, + { + annotationName: "Local File Path", + annotationDisplayName: "Local File Path", + description: "Path to file in on-premises storage.", + type: "Text", + }, ]; diff --git a/packages/core/services/AnnotationService/HttpAnnotationService/test/HttpAnnotationService.test.ts b/packages/core/services/AnnotationService/HttpAnnotationService/test/HttpAnnotationService.test.ts index 9d9db25dd..e5e31af5a 100644 --- a/packages/core/services/AnnotationService/HttpAnnotationService/test/HttpAnnotationService.test.ts +++ b/packages/core/services/AnnotationService/HttpAnnotationService/test/HttpAnnotationService.test.ts @@ -31,6 +31,16 @@ describe("HttpAnnotationService", () => { ); expect(annotations[0]).to.be.instanceOf(Annotation); }); + + it("renames Local File Path to File Path (Local)", async () => { + const annotationService = new HttpAnnotationService({ + fileExplorerServiceBaseUrl: FESBaseUrl.TEST, + httpClient, + }); + const annotations = await annotationService.fetchAnnotations(); + const localPathAnnotation = annotations.find((a) => a.name === "Local File Path"); + expect(localPathAnnotation?.displayName).to.equal("File Path (Local)"); + }); }); describe("fetchAnnotationValues", () => {