refactor(server): user info endpoint (#9668)

* refactor(server): user info endpoint

* chore: open api
This commit is contained in:
Jason Rasmussen 2024-05-22 14:15:33 -04:00 committed by GitHub
parent 202745f14b
commit ecd018a826
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 64 additions and 66 deletions

View file

@ -93,15 +93,15 @@ describe('/users', () => {
});
});
describe('GET /users/info/:id', () => {
describe('GET /users/:id', () => {
it('should require authentication', async () => {
const { status } = await request(app).get(`/users/info/${admin.userId}`);
const { status } = await request(app).get(`/users/${admin.userId}`);
expect(status).toEqual(401);
});
it('should get the user info', async () => {
const { status, body } = await request(app)
.get(`/users/info/${admin.userId}`)
.get(`/users/${admin.userId}`)
.set('Authorization', `Bearer ${admin.accessToken}`);
expect(status).toBe(200);
expect(body).toMatchObject({