1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

update server tests

This commit is contained in:
Matthias Kretschmann 2019-09-06 13:50:36 +02:00
parent 85ffae37d1
commit 414dcd455a
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -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 () => {