diff --git a/packages/hydra/test/collection.test.ts b/packages/hydra/test/collection.test.ts index bc50ef6..1714266 100644 --- a/packages/hydra/test/collection.test.ts +++ b/packages/hydra/test/collection.test.ts @@ -158,6 +158,24 @@ describe('@kopflos-cms/hydra', () => { const pointer = $rdf.clownface({ dataset }).node(collection) expect(pointer.out(ns.hydra.member).terms).to.have.length.above(200) }) + + it('should fail when endpoint is not configured', async function () { + // given + const kopflos = await startKopflos() + + // when + const collection = ex['countries/wrong-endpoint'] + const res = await kopflos.handleRequest({ + method: 'GET', + iri: collection, + headers: {}, + query: {}, + body: {} as Body, + }) + + // then + expect(res.status).to.equal(500) + }) }) }) diff --git a/packages/hydra/test/collection.test.ts.trig b/packages/hydra/test/collection.test.ts.trig index d863694..53cb507 100644 --- a/packages/hydra/test/collection.test.ts.trig +++ b/packages/hydra/test/collection.test.ts.trig @@ -92,3 +92,20 @@ GRAPH { ] ; . } + +GRAPH { + + a hydra:Collection ; + hydra:memberAssertion + [ + hydra:property rdf:type ; + hydra:object schema:Country ; + ] ; + kl:endpoint "foobar" ; + kl-hydra:memberShape + [ + sh:property [ sh:path schema:name ] ; + sh:property [ sh:path schema:identifier ] ; + ] ; + . +}