refactor(server): auth delete device (#4720)

* refactor(server): auth delete device

* fix: person e2e
This commit is contained in:
Jason Rasmussen 2023-10-30 11:48:38 -04:00 committed by GitHub
parent ce04e9e07a
commit 603b056512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 76 additions and 20 deletions

View file

@ -189,6 +189,14 @@ describe(`${AuthController.name} (e2e)`, () => {
expect(body).toEqual(errorStub.unauthorized);
});
it('should throw an error for a non-existent device id', async () => {
const { status, body } = await request(server)
.delete(`/auth/devices/${uuidStub.notFound}`)
.set('Authorization', `Bearer ${accessToken}`);
expect(status).toBe(400);
expect(body).toEqual(errorStub.badRequest('Not found or no authDevice.delete access'));
});
it('should logout a device', async () => {
const [device] = await api.authApi.getAuthDevices(server, accessToken);
const { status } = await request(server)