feat(security): harden the API, trust Hiboutik for deletions, lock syncs (#3)
This commit is contained in:
@@ -27,12 +27,12 @@ describe('AppController (e2e)', () => {
|
||||
});
|
||||
|
||||
it('POST /sync starts a synchronization (202)', () => {
|
||||
hiboutikService.startSync.mockReturnValue(true);
|
||||
hiboutikService.startSync.mockResolvedValue(true);
|
||||
return request(app.getHttpServer()).post('/sync').expect(202).expect({ message: 'Hiboutik synchronization started' });
|
||||
});
|
||||
|
||||
it('POST /sync answers 409 when a synchronization is already running', () => {
|
||||
hiboutikService.startSync.mockReturnValue(false);
|
||||
hiboutikService.startSync.mockResolvedValue(false);
|
||||
return request(app.getHttpServer()).post('/sync').expect(409);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user