From d5db67c4b4cdcad892a6bbf716c5299e3074a746 Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Tue, 12 Nov 2024 12:14:18 +0100 Subject: [PATCH] Add test for 'cannot approve sequences with errors --- .../ApproveProcessedDataEndpointTest.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/backend/src/test/kotlin/org/loculus/backend/controller/submission/ApproveProcessedDataEndpointTest.kt b/backend/src/test/kotlin/org/loculus/backend/controller/submission/ApproveProcessedDataEndpointTest.kt index cc3afd4d2..bf7e291b6 100644 --- a/backend/src/test/kotlin/org/loculus/backend/controller/submission/ApproveProcessedDataEndpointTest.kt +++ b/backend/src/test/kotlin/org/loculus/backend/controller/submission/ApproveProcessedDataEndpointTest.kt @@ -324,6 +324,25 @@ class ApproveProcessedDataEndpointTest( .assertStatusIs(PROCESSED) } + @Test + fun `WHEN approving sequences with errors THEN an error is raised`() { + val submittedSequences = + convenienceClient.prepareDefaultSequenceEntriesToInProcessing() + val accessionOfDataWithErrors = submittedSequences[0].accession + convenienceClient.submitProcessedData( + PreparedProcessedData.withErrors(accession = accessionOfDataWithErrors), + ) + + client.approveProcessedSequenceEntries( + scope = WITHOUT_WARNINGS, + accessionVersionsFilter = listOf(AccessionVersion(accessionOfDataWithErrors, 1)), + ) + .andExpect(status().isUnprocessableEntity) + + convenienceClient.getSequenceEntry(accession = accessionOfDataWithErrors, version = 1) + .assertStatusIs(PROCESSED) + } + @Test fun `WHEN superuser approves all entries THEN is successfully approved`() { val accessionVersions = convenienceClient