diff --git a/data-serving/data-service/api/openapi.yaml b/data-serving/data-service/api/openapi.yaml index c883b8964..26f44f48b 100644 --- a/data-serving/data-service/api/openapi.yaml +++ b/data-serving/data-service/api/openapi.yaml @@ -1040,12 +1040,16 @@ components: description: name of a country admin1: type: string + nullable: true admin2: type: string + nullable: true admin3: type: string + nullable: true location: type: string + nullable: true description: exact location ageRange: type: object diff --git a/data-serving/data-service/src/controllers/case.ts b/data-serving/data-service/src/controllers/case.ts index fedb0f011..0e0ffbd40 100644 --- a/data-serving/data-service/src/controllers/case.ts +++ b/data-serving/data-service/src/controllers/case.ts @@ -1130,6 +1130,7 @@ export class CasesController { // eslint-disable-next-line @typescript-eslint/no-explicit-any const upsertLambda = async (c: any) => { delete c.caseCount; + c.bundleId = new mongoose.Types.ObjectId(); c = await caseFromDTO(c as CaseDTO); if ( diff --git a/verification/curator-service/api/openapi/openapi.yaml b/verification/curator-service/api/openapi/openapi.yaml index 6f2d69901..40d98d96e 100644 --- a/verification/curator-service/api/openapi/openapi.yaml +++ b/verification/curator-service/api/openapi/openapi.yaml @@ -1861,12 +1861,16 @@ components: description: name of a country admin1: type: string + nullable: true admin2: type: string + nullable: true admin3: type: string + nullable: true location: type: string + nullable: true description: exact location ageRange: type: object diff --git a/verification/curator-service/ui/cypress/e2e/components/BulkVerification.ts b/verification/curator-service/ui/cypress/e2e/components/BulkVerification.ts new file mode 100644 index 000000000..c166afa9e --- /dev/null +++ b/verification/curator-service/ui/cypress/e2e/components/BulkVerification.ts @@ -0,0 +1,61 @@ +import { CaseStatus } from '../../support/commands'; +import {Role} from "../../../src/api/models/User"; + +/* eslint-disable no-undef */ +describe('Linelist table', function () { + beforeEach(() => { + cy.task('clearCasesDB', {}); + cy.intercept('GET', '/auth/profile').as('getProfile'); + cy.intercept('GET', '/api/cases*').as('getCases'); + }); + + afterEach(() => { + cy.clearSeededLocations(); + }); + + it('Displays and verifies bundled cases correctly', function () { + cy.login({roles: [ Role.JuniorCurator ]}) + cy.addCase({ + country: 'France', + countryISO3: 'FRA', + dateEntry: '2020-05-01', + dateReported: '2020-05-01', + sourceUrl: 'www.example.com', + caseStatus: CaseStatus.Confirmed, + }); + cy.logout(); + cy.login({roles: [ Role.Curator ]}) + + // Make sure that case is not verified + cy.visit('/'); + cy.wait('@getProfile'); + cy.wait('@getCases'); + cy.get('[data-testid="CheckCircleOutlineIcon"]').should('not.exist'); + + // Verify case + cy.visit('/bulk-verification'); + + // We don't need additional library for just one test, we can format date manually + const today = new Date(); + const year = today.getFullYear(); + const month = today.getMonth() < 9 ? `0${today.getMonth() + 1}` : today.getMonth() + 1; + const day = today.getDate() < 10 ? `0${today.getDate()}` : today.getDate(); + cy.contains(`${year}-${month}-${day}`) + cy.contains('superuser@test.com'); + cy.contains('France'); + cy.contains('www.example.com'); + cy.contains('2020-05-01'); + cy.contains('confirmed'); + cy.get('tr').get('input[type="checkbox"]').check(); + cy.get('[data-testid="verify-case-bundles-button"]').click(); + cy.get('[data-testid="confirm-case-bundles-verification-button"]').click(); + + // Case bundle no longer shows in bulk verification list + cy.contains('No records to display').should('exist'); + + // Case from case bundle is now verified + cy.visit('/'); + cy.wait('@getCases'); + cy.get('[data-testid="CheckCircleOutlineIcon"]').should('exist'); + }); +}); diff --git a/verification/curator-service/ui/src/components/BulkVerification/EnhancedTableToolbar.tsx b/verification/curator-service/ui/src/components/BulkVerification/EnhancedTableToolbar.tsx index e62d1e501..b05827b13 100644 --- a/verification/curator-service/ui/src/components/BulkVerification/EnhancedTableToolbar.tsx +++ b/verification/curator-service/ui/src/components/BulkVerification/EnhancedTableToolbar.tsx @@ -103,6 +103,7 @@ const EnhancedTableToolbar = () => { dispatch(setVerifyCasesDialogOpen(true)) } diff --git a/verification/curator-service/ui/src/components/Dialogs/CaseVerifyDialog.tsx b/verification/curator-service/ui/src/components/Dialogs/CaseVerifyDialog.tsx index e5b23772c..c36fc29a4 100644 --- a/verification/curator-service/ui/src/components/Dialogs/CaseVerifyDialog.tsx +++ b/verification/curator-service/ui/src/components/Dialogs/CaseVerifyDialog.tsx @@ -86,6 +86,7 @@ export const CaseVerifyDialog = ({ onClick={() => dispatch(verifyCaseBundle({ caseBundleIds, query })) } + data-testid="confirm-case-bundles-verification-button" color="primary" > {verificationLoading ? : 'Yes'}