Result should be valid when a project has no POFs

This commit is contained in:
Johannes Klein
2026-07-14 15:25:23 +02:00
parent 39b113b48f
commit 67b8ccb7ef

View File

@@ -500,4 +500,13 @@ describe( "validateProjectFieldsForObservation", () => {
expect( resultBA.errors.map( e => e.projectTitle ) ).toEqual( ["Project B", "Project A"] );
} );
} );
describe( "edge cases", () => {
it( "should be valid when no projects are passed", () => {
const mockObservation = { observationFieldValues: [] };
const result = validateProjectFieldsForObservation( mockObservation, [] );
expect( result.valid ).toBe( true );
expect( result.errors ).toEqual( [] );
} );
} );
} );