Ajoute projet et migration milestone

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-05-31 10:00:36 +02:00
parent 54d1534d4d
commit fe1c346eac
11 changed files with 108 additions and 89 deletions
+11
View File
@@ -122,6 +122,17 @@ describe('ProjectsStore', () => {
expect(store.getById(99)?.name).toBe('New Project');
});
it('preserves local fields when the API response omits owner/status/progress', async () => {
const p = store.upsert(makeProject({ id: 0, name: 'Minimal', owner: 'Cedric', status: 'Nouveau', progress: 0 }));
httpMock.expectOne({ method: 'POST', url: `${API}/projects` }).flush({ id: 100, name: 'Minimal' });
await p;
expect(store.getById(100)?.owner).toBe('Cedric');
expect(store.getById(100)?.status).toBe('Nouveau');
expect(store.getById(100)?.progress).toBe(0);
});
it('updates an existing project via PUT', async () => {
const p = store.upsert(makeProject({ id: 1, name: 'Updated' }));
httpMock.expectOne({ method: 'PUT', url: `${API}/projects/1` }).flush(makeProject({ id: 1, name: 'Updated' }));