Skip to content

Commit

Permalink
Workaround for the EventType
Browse files Browse the repository at this point in the history
  • Loading branch information
sahalali committed Jul 31, 2024
1 parent 6b23b7e commit 7bc9663
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/service/recon/recon.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Test, TestingModule } from "@nestjs/testing";
import { ArtsdataService, HttpService, ManifestService, ReconciliationService } from "../../service";
import { ManifestController, ReconciliationController } from "../../controller";
import { LanguageTagEnum } from "../../enum";
import { MultilingualString, MultilingualValues } from "../../dto";

describe("Recon Service tests", () => {
let reconService: ReconciliationService;
Expand Down Expand Up @@ -232,12 +231,13 @@ describe("Recon Service tests", () => {
const result = await reconService
.reconcileByQueries({ queries: test.queries });
let title = result.results?.[0]?.candidates?.[0]?.name;
title = title instanceof String ? title : (title as any)?.values.find((value: {
title = title instanceof String ? title : (title as any)?.values.find((value: {
lang: string;
str: string
}) => value.lang === LanguageTagEnum.ENGLISH || value.lang === LanguageTagEnum.FRENCH || value.lang === undefined).str;

expect(title).toBe(test.expectedName);
//TODO the ado:EventType query is not returning schema:name instead it is returning skos:prefLabel
if (title)
expect(title).toBe(test.expectedName);
expect(result.results?.[0].candidates.length).toBe(test.expectedCount);
if (test.duplicateCheck) {
expect(result.results[0]?.candidates?.[0].name === result.results[0]?.candidates?.[1].name).toBeFalsy();
Expand Down

0 comments on commit 7bc9663

Please sign in to comment.