From 414dcd455a6159a5a49c918611f0647ec14e3bad Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 6 Sep 2019 13:50:36 +0200 Subject: [PATCH] update server tests --- server/test/api.test.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/server/test/api.test.ts b/server/test/api.test.ts index b319df1..f368ff3 100644 --- a/server/test/api.test.ts +++ b/server/test/api.test.ts @@ -13,9 +13,22 @@ describe('GET /', () => { }) describe('POST /api/v1/urlcheck', () => { - it('responds with json', async () => { - const response = await request(server).post('/api/v1/urlcheck') + it('responds with json on http://', async () => { + const response = await request(server) + .post('/api/v1/urlcheck') + .send({ url: 'https://oceanprotocol.com/tech-whitepaper.pdf' }) expect(response.status).toBe(200) + expect(response.body).toBeTruthy() + }) + + it('responds with json on ipfs://', async () => { + const response = await request(server) + .post('/api/v1/urlcheck') + .send({ + url: 'ipfs://QmQfpdcMWnLTXKKW9GPV7NgtEugghgD6HgzSF6gSrp2mL9' + }) + expect(response.status).toBe(200) + expect(response.body).toBeTruthy() }) it('responds with error message when url is missing', async () => {