-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import request from 'supertest' | ||
import express from 'express' | ||
import { router } from '../fhir' | ||
|
||
const app = express() | ||
app.use('/', router) | ||
|
||
describe('FHIR Routes', () => { | ||
it('should return 200 OK for GET /', async () => { | ||
const response = await request(app).get('/') | ||
expect(response.status).toBe(200) | ||
expect(response.text).toBe('/') | ||
}) | ||
|
||
it('should return 200 OK for GET /metadata', async () => { | ||
const response = await request(app).get('/metadata') | ||
expect(response.status).toBe(200) | ||
// Add more assertions for the response body if needed | ||
}) | ||
|
||
it('should return 400 Bad Request for GET with invalid resource type', async () => { | ||
const response = await request(app).get('/invalid-resource') | ||
expect(response.status).toBe(400) | ||
expect(response.body).toEqual({ message: 'Invalid resource type invalid-resource' }) | ||
}) | ||
|
||
// Add more test cases for other routes and scenarios | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import request from 'supertest' | ||
import express from 'express' | ||
import { router } from '../ips' | ||
|
||
const app = express() | ||
app.use('/', router) | ||
|
||
describe('IPS Routes', () => { | ||
it('should return 200 OK for GET /', async () => { | ||
const response = await request(app).get('/') | ||
expect(response.status).toBe(200) | ||
expect(response.text).toBe('/') | ||
}) | ||
|
||
it('should return 200 OK for GET /metadata', async () => { | ||
const response = await request(app).get('/metadata') | ||
expect(response.status).toBe(200) | ||
// Add more assertions for the response body if needed | ||
}) | ||
|
||
it('should return 200 OK for GET /Patient/cruid/:id/:lastUpdated?', async () => { | ||
const response = await request(app).get('/Patient/cruid/12345') | ||
expect(response.status).toBe(200) | ||
// Add more assertions for the response body if needed | ||
}) | ||
|
||
it('should return 200 OK for GET /Patient/:id/:lastUpdated?', async () => { | ||
const response = await request(app).get('/Patient/67890') | ||
expect(response.status).toBe(200) | ||
// Add more assertions for the response body if needed | ||
}) | ||
|
||
it('should return 200 OK for GET /:location?/:lastUpdated?', async () => { | ||
const response = await request(app).get('/location1') | ||
expect(response.status).toBe(200) | ||
// Add more assertions for the response body if needed | ||
}) | ||
|
||
it('should return 500 Internal Server Error for GET /:location?/:lastUpdated? when golden record not found', async () => { | ||
const response = await request(app).get('/location2') | ||
expect(response.status).toBe(500) | ||
}) | ||
|
||
// Add more test cases for other routes and scenarios | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters