mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: e2e test
This commit is contained in:
parent
b88da7b82e
commit
6e1ee37362
1 changed files with 6 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import {
|
||||||
createStack,
|
createStack,
|
||||||
deleteUserAdmin,
|
deleteUserAdmin,
|
||||||
getMyUser,
|
getMyUser,
|
||||||
|
getSessions,
|
||||||
getUserAdmin,
|
getUserAdmin,
|
||||||
getUserPreferencesAdmin,
|
getUserPreferencesAdmin,
|
||||||
login,
|
login,
|
||||||
|
|
@ -59,6 +60,7 @@ describe('/admin/users', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide deleted users by default', async () => {
|
it('should hide deleted users by default', async () => {
|
||||||
|
const expectedSessions = await getSessions({ headers: asBearerAuth(admin.accessToken) });
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get(`/admin/users`)
|
.get(`/admin/users`)
|
||||||
.set('Authorization', `Bearer ${admin.accessToken}`);
|
.set('Authorization', `Bearer ${admin.accessToken}`);
|
||||||
|
|
@ -71,8 +73,11 @@ describe('/admin/users', () => {
|
||||||
expect.objectContaining({ email: userToDelete.userEmail }),
|
expect.objectContaining({ email: userToDelete.userEmail }),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(body.find((u: any) => u.id === admin.userId)?.latestSession).toBeDefined();
|
expect(body.find((u: any) => u.id === admin.userId)?.latestSession).toBeDefined();
|
||||||
expect(body.find((u: any) => u.id === admin.userId)?.latestSession.updatedAt).toBeInstanceOf(Date);
|
expect(body.find((u: any) => u.id === admin.userId)?.latestSession.updatedAt).toEqual(
|
||||||
|
expectedSessions[0].updatedAt,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include deleted users', async () => {
|
it('should include deleted users', async () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue