Ajoute projet et migration milestone
Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
@@ -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' }));
|
||||
|
||||
Reference in New Issue
Block a user