From c1284249710cebd5159f29ab0879cca6aa1931a7 Mon Sep 17 00:00:00 2001 From: Fabian Engelniederhammer Date: Wed, 22 Jan 2025 12:21:15 +0100 Subject: [PATCH] fix tests and format --- .../main/kotlin/org/loculus/backend/config/Config.kt | 4 +--- .../src/components/SearchPage/SearchFullUI.spec.tsx | 12 +++++++----- website/src/components/SearchPage/SearchFullUI.tsx | 2 +- website/src/components/Submission/RevisionForm.tsx | 2 +- website/src/components/Submission/SubmissionForm.tsx | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/src/main/kotlin/org/loculus/backend/config/Config.kt b/backend/src/main/kotlin/org/loculus/backend/config/Config.kt index e258e2787..a56907619 100644 --- a/backend/src/main/kotlin/org/loculus/backend/config/Config.kt +++ b/backend/src/main/kotlin/org/loculus/backend/config/Config.kt @@ -26,9 +26,7 @@ data class Schema( val submissionDataTypes: SubmissionDataTypes = SubmissionDataTypes(), ) -data class SubmissionDataTypes( - val consensusSequences: Boolean = true, -) +data class SubmissionDataTypes(val consensusSequences: Boolean = true) // The Json property names need to be kept in sync with website config enum `metadataPossibleTypes` in `config.ts` // They also need to be in sync with SILO database config, as the Loculus config is a sort of superset of it diff --git a/website/src/components/SearchPage/SearchFullUI.spec.tsx b/website/src/components/SearchPage/SearchFullUI.spec.tsx index 0d6c25600..7e77bb21e 100644 --- a/website/src/components/SearchPage/SearchFullUI.spec.tsx +++ b/website/src/components/SearchPage/SearchFullUI.spec.tsx @@ -3,11 +3,11 @@ import { render, screen, waitFor, waitForElementToBeRemoved } from '@testing-lib import userEvent from '@testing-library/user-event'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { SearchFullUI } from './SearchFullUI'; -import { testConfig, testOrganism, testSiteName } from '../../../vitest.setup.ts'; +import { type InnerSearchFullUIProps, SearchFullUI } from './SearchFullUI'; +import { testConfig, testOrganism } from '../../../vitest.setup.ts'; import { lapisClientHooks } from '../../services/serviceHooks.ts'; import type { MetadataFilter, Schema } from '../../types/config.ts'; -import type { ReferenceGenomesSequenceNames, ReferenceAccession } from '../../types/referencesGenomes.ts'; +import type { ReferenceAccession, ReferenceGenomesSequenceNames } from '../../types/referencesGenomes.ts'; global.ResizeObserver = class FakeResizeObserver { observe() {} @@ -89,18 +89,20 @@ function renderSearchFullUI({ accessToken: 'dummyAccessToken', referenceGenomesSequenceNames, myGroups: [], - websiteName: testSiteName, organism: testOrganism, clientConfig, schema: { metadata: metadataSchema, tableColumns: ['field1', 'field3'], primaryKey: 'accession', + submissionDataTypes: { + consensusSequences: true, + }, } as Schema, initialData: [], initialCount: 0, initialQueryDict: {}, - }; + } satisfies InnerSearchFullUIProps; render( diff --git a/website/src/components/SearchPage/SearchFullUI.tsx b/website/src/components/SearchPage/SearchFullUI.tsx index 43f12af61..e71298192 100644 --- a/website/src/components/SearchPage/SearchFullUI.tsx +++ b/website/src/components/SearchPage/SearchFullUI.tsx @@ -34,7 +34,7 @@ import { import { EditDataUseTermsModal } from '../DataUseTerms/EditDataUseTermsModal.tsx'; import ErrorBox from '../common/ErrorBox.tsx'; -interface InnerSearchFullUIProps { +export interface InnerSearchFullUIProps { accessToken?: string; referenceGenomesSequenceNames: ReferenceGenomesSequenceNames; myGroups: Group[]; diff --git a/website/src/components/Submission/RevisionForm.tsx b/website/src/components/Submission/RevisionForm.tsx index 5287ca8ec..8666cd249 100644 --- a/website/src/components/Submission/RevisionForm.tsx +++ b/website/src/components/Submission/RevisionForm.tsx @@ -5,9 +5,9 @@ import { DataUploadForm } from './DataUploadForm.tsx'; import { routes } from '../../routes/routes.ts'; import { type Group } from '../../types/backend.ts'; import type { InputField } from '../../types/config.ts'; +import type { SubmissionDataTypes } from '../../types/config.ts'; import type { ReferenceGenomesSequenceNames } from '../../types/referencesGenomes'; import type { ClientConfig } from '../../types/runtimeConfig.ts'; -import type { SubmissionDataTypes } from '../../types/config.ts'; type RevisionFormProps = { accessToken: string; diff --git a/website/src/components/Submission/SubmissionForm.tsx b/website/src/components/Submission/SubmissionForm.tsx index e711bd7ae..9096b1308 100644 --- a/website/src/components/Submission/SubmissionForm.tsx +++ b/website/src/components/Submission/SubmissionForm.tsx @@ -5,9 +5,9 @@ import { DataUploadForm } from './DataUploadForm.tsx'; import { routes } from '../../routes/routes.ts'; import { type Group } from '../../types/backend.ts'; import type { InputField } from '../../types/config.ts'; +import type { SubmissionDataTypes } from '../../types/config.ts'; import type { ReferenceGenomesSequenceNames } from '../../types/referencesGenomes'; import type { ClientConfig } from '../../types/runtimeConfig.ts'; -import type { SubmissionDataTypes } from '../../types/config.ts'; type SubmissionFormProps = { accessToken: string;