Skip to content

Commit

Permalink
test (read resource): determine link prop Iri form link value prop Iri
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Schweizer committed Mar 13, 2020
1 parent 4e0d7d8 commit 3848979
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/models/v2/resources/ResourcesConversionUtil.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,22 @@ describe("ResourcesConversionUtil", () => {

});

it("attempt to determine a link property IRI from a non link value property IRI", done => {

const resource = require("../../../../test/data/api/v2/resources/testding-expanded.json");

ResourcesConversionUtil.createReadResourceSequence(resource, knoraApiConnection.v2.ontologyCache, knoraApiConnection.v2.listNodeCache, jsonConvert).subscribe(
resSeq => {

expect(
() => {
resSeq[0].getLinkPropertyIriFromLinkValuePropertyIri("http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherThing");
}).toThrow(new Error("http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherThing is not a valid link value property IRI"));

done();
});
});

it("parse JSON-lD representing a resource with a StillImageRepresentation", done => {
const resource = require("../../../../test/data/api/v2/values/get-still-image-file-value-response-expanded.json");

Expand Down

0 comments on commit 3848979

Please sign in to comment.