From c2572690ffbccc0f717fecccf43d7bd3981da47a Mon Sep 17 00:00:00 2001 From: F-Node-Karlsruhe Date: Wed, 14 Jun 2023 17:46:19 +0200 Subject: [PATCH] fix presentation test Signed-off-by: F-Node-Karlsruhe --- api/__tests__/presentation.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/__tests__/presentation.test.ts b/api/__tests__/presentation.test.ts index 54e1ecc..dae448c 100644 --- a/api/__tests__/presentation.test.ts +++ b/api/__tests__/presentation.test.ts @@ -164,9 +164,13 @@ describe("Verifier API Test for Presentations", () => { }); }); - test("Falsify single presentation without challenge", async () => { - const res = await request(app).post("/api/verifier").query({ domain: 'ssi.eecc.de/verifier' }).send([domainPresentation]); - expect(res.statusCode).toEqual(400); + test("Falsify single presentation with wrong challenge", async () => { + const res = await request(app).post("/api/verifier").query({ challenge: 'falseChallenge', domain: 'ssi.eecc.de/verifier' }).send([domainPresentation]); + expect(res.statusCode).toEqual(200); + expect(res.body[0]).toHaveProperty('verified'); + expect(res.body[0].verified).toBe(false); + expect(res.body[0]).toHaveProperty('error'); + expect(res.body[0].error.name).toBe('VerificationError'); }); }); \ No newline at end of file