Skip to content

Commit

Permalink
test: ensure there is no data in the body
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenakh97 committed Jul 2, 2024
1 parent 8846fd1 commit f1b3647
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions e2e-tests/e2eTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ void describe('e2e-tests', () => {
})
void it('should return statusCode 409 and cache max-age=60 when the SIM information is not in DB', async () => {
const req = await fetchData(getRandomICCID())
const text = await req.text()
const expectedCacheControl = 'public, max-age=60'
assert.equal(req.headers.get('cache-control'), expectedCacheControl)
assert.equal(req.status, 409)
assert.equal(req.headers.get('content-length'), '0')
assert.equal(text, '')
})
void it('should return statusCode 404 and cache max-age=60 when the SIM is not existing', async () => {
const req = await fetchData(iccidNotExisting)
const text = await req.text()
const expectedCacheControl = 'public, max-age=60'
assert.equal(req.headers.get('cache-control'), expectedCacheControl)
assert.equal(req.status, 404)
assert.equal(req.headers.get('content-length'), '0')
assert.equal(text, '')
})
void it('should return statusCode 200, cache max-age=300 and correct body if the data is in cache', async () => {
const req = await fetchData(iccidNew)
Expand Down

0 comments on commit f1b3647

Please sign in to comment.