mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web,server): user memory settings (#3628)
* feat(web,server): user preference for time-based memories * chore: open api * dev: mobile * fix: update * mobile work --------- Co-authored-by: Alex <alex.tran1502@gmail.com> Co-authored-by: Alex Tran <Alex.Tran@conductix.com>
This commit is contained in:
parent
343087e2b4
commit
a6eb227330
33 changed files with 519 additions and 25 deletions
|
|
@ -143,6 +143,24 @@ describe(`${UserController.name}`, () => {
|
|||
});
|
||||
expect(status).toBe(201);
|
||||
});
|
||||
|
||||
it('should create a user without memories enabled', async () => {
|
||||
const { status, body } = await request(server)
|
||||
.post(`/user`)
|
||||
.send({
|
||||
email: 'no-memories@immich.app',
|
||||
password: 'Password123',
|
||||
firstName: 'No Memories',
|
||||
lastName: 'User',
|
||||
memoriesEnabled: false,
|
||||
})
|
||||
.set('Authorization', `Bearer ${accessToken}`);
|
||||
expect(body).toMatchObject({
|
||||
email: 'no-memories@immich.app',
|
||||
memoriesEnabled: false,
|
||||
});
|
||||
expect(status).toBe(201);
|
||||
});
|
||||
});
|
||||
|
||||
describe('PUT /user', () => {
|
||||
|
|
@ -206,6 +224,21 @@ describe(`${UserController.name}`, () => {
|
|||
});
|
||||
expect(before.updatedAt).not.toEqual(after.updatedAt);
|
||||
});
|
||||
|
||||
it('should update memories enabled', async () => {
|
||||
const before = await api.userApi.get(server, accessToken, loginResponse.userId);
|
||||
const after = await api.userApi.update(server, accessToken, {
|
||||
id: before.id,
|
||||
memoriesEnabled: false,
|
||||
});
|
||||
|
||||
expect(after).toMatchObject({
|
||||
...before,
|
||||
updatedAt: expect.anything(),
|
||||
memoriesEnabled: false,
|
||||
});
|
||||
expect(before.updatedAt).not.toEqual(after.updatedAt);
|
||||
});
|
||||
});
|
||||
|
||||
describe('GET /user/count', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue