diff --git a/src/app/components/annotations/pages/search/search.component.spec.ts b/src/app/components/annotations/pages/search/search.component.spec.ts index c37d3d0ed..0b199862b 100644 --- a/src/app/components/annotations/pages/search/search.component.spec.ts +++ b/src/app/components/annotations/pages/search/search.component.spec.ts @@ -119,8 +119,7 @@ describe("AnnotationSearchComponent", () => { mockAnnotationResponse = new Annotation( generateAnnotation({ audioRecording: mockAudioRecording, - }), - injector + }) ); audioEventsApiSpy = spectator.inject(SHALLOW_AUDIO_EVENT.token); diff --git a/src/app/components/annotations/pages/verification/verification.component.spec.ts b/src/app/components/annotations/pages/verification/verification.component.spec.ts index 680a5da6c..9924a44a8 100644 --- a/src/app/components/annotations/pages/verification/verification.component.spec.ts +++ b/src/app/components/annotations/pages/verification/verification.component.spec.ts @@ -153,10 +153,7 @@ describe("VerificationComponent", () => { injector ); - mockAnnotationResponse = new Annotation( - generateAnnotation({ audioRecording: mockAudioRecording }), - injector - ); + mockAnnotationResponse = new Annotation(generateAnnotation({ audioRecording: mockAudioRecording })); spectator.component.searchParameters = mockSearchParameters; spectator.component.project = routeProject; diff --git a/src/app/components/shared/audio-event-card/annotation-event-card.component.spec.ts b/src/app/components/shared/audio-event-card/annotation-event-card.component.spec.ts index 3f8a212b9..c49549347 100644 --- a/src/app/components/shared/audio-event-card/annotation-event-card.component.spec.ts +++ b/src/app/components/shared/audio-event-card/annotation-event-card.component.spec.ts @@ -75,7 +75,6 @@ describe("AudioEventCardComponent", () => { endTimeSeconds: 5, tags: [mockTag], }), - injectorSpy ); audioRecordingApiSpy = spectator.inject(AUDIO_RECORDING.token); diff --git a/src/app/components/web-components/grid-tile-content/grid-tile-content.component.spec.ts b/src/app/components/web-components/grid-tile-content/grid-tile-content.component.spec.ts index 04dd48955..6c85bfd3a 100644 --- a/src/app/components/web-components/grid-tile-content/grid-tile-content.component.spec.ts +++ b/src/app/components/web-components/grid-tile-content/grid-tile-content.component.spec.ts @@ -65,7 +65,6 @@ describe("GridTileContentComponent", () => { audioRecording: mockAudioRecording, audioRecordingId: mockAudioRecording.id, }), - injectorSpy ); updateContext(mockAnnotation); @@ -111,7 +110,7 @@ describe("GridTileContentComponent", () => { }); it("should have the correct audio link if a new subject is provided", () => { - const newTestSubject = new Annotation(generateAnnotation(), injectorSpy); + const newTestSubject = new Annotation(generateAnnotation()); updateContext(newTestSubject); const expectedHref = newTestSubject.viewUrl; diff --git a/src/app/models/data/Annotation.ts b/src/app/models/data/Annotation.ts index dfd4b6f06..de07f912c 100644 --- a/src/app/models/data/Annotation.ts +++ b/src/app/models/data/Annotation.ts @@ -11,24 +11,15 @@ import { MediaService } from "@services/media/media.service"; export interface IAnnotation extends Required { tags: ITag[]; audioRecording: AudioRecording; - - viewUrl: string; - listenViewUrl: string; - audioLink: string; } -type AnnotationConstructor = Omit; - // this class is not backed by the api or a database table // I have created this model so that we can pass around a single model that // contains all the information we need about an annotation // // this model is created from the AnnotationService and MediaService's -export class Annotation - extends AbstractData - implements IAnnotation -{ - public constructor(data: AnnotationConstructor) { +export class Annotation extends AbstractData implements IAnnotation { + public constructor(data: any) { super(data); this.viewUrl = annotationMenuItem.route.format({