Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding SeqvarScoresCard #51

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const preview: Preview = {

setup((app: App) => {
// Use pinia for state management, also in pinia.
console.log('Using pinia for state management')
app.use(pinia)
// Registers your app's plugins into Storybook
registerPlugins(app)
Expand Down
10 changes: 6 additions & 4 deletions src/api/annonars/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export interface SeqvarInfoResult$Api {
gnomad_exomes: Gnomad2Record | Gnomad3Record | Gnomad4Record | null
gnomad_genomes: Gnomad2Record | Gnomad3Record | Gnomad4Record | null
helixmtdb: HelixmtdbRecord | null
ucsc_conservation: UcscConservationRecord[]
ucsc_conservation: {
records: UcscConservationRecord[]
}[]
clinvar: null
}

Expand All @@ -88,7 +90,7 @@ export interface SeqvarInfoResult {
gnomadExomes?: Gnomad2Record | Gnomad3Record | Gnomad4Record
gnomadGenomes?: Gnomad2Record | Gnomad3Record | Gnomad4Record
helixmtdb?: HelixmtdbRecord
ucscConservation: UcscConservationRecord[]
ucscConservation: UcscConservationRecord[][]
clinvar?: ClinvarRecord
}

Expand Down Expand Up @@ -122,7 +124,7 @@ class SeqvarInfoResult$Type {
? undefined
: // @ts-ignore
HelixmtdbRecord.fromJson(apiResult.helixmtdb as JsonValue),
ucscConservation: apiResult.ucsc_conservation,
ucscConservation: apiResult.ucsc_conservation.map((cons) => cons.records),
clinvar:
apiResult.clinvar === null
? undefined
Expand Down Expand Up @@ -159,7 +161,7 @@ export interface SeqvarInfoResponse {
* Helper class to convert `SeqvarInfoResponse$Api` to `SeqvarInfoResponse`.
*/
class SeqvarInfoResponse$Type {
static fromJson(apiResponse: SeqvarInfoResponse$Api): SeqvarInfoResponse {
fromJson(apiResponse: SeqvarInfoResponse$Api): SeqvarInfoResponse {
return {
serverVersion: apiResponse.server_version,
query: SeqvarInfoQuery.fromJson(apiResponse.query),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ describe.concurrent('GeneConditionsCard.vue', async () => {

// assert:
expect(showTermsIdSwitch?.vm.$props.value).toBe(true)
console.log(wrapper.text())
expect(wrapper.text()).toContain('HP:0000001')
expect(wrapper.text()).toContain('HP:0000002')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const BRCA1: Story = {
geneInfo: geneInfoBrca1
},
play: async () => {
console.log('play...')
// Setup the store contents after story selection.
const pubtatorStore = usePubtatorStore()
pubtatorStore.storeState = StoreState.Loading
Expand Down
26 changes: 26 additions & 0 deletions src/components/SeqvarScoresCard/ScoreDisplay.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { describe, expect, it } from 'vitest'

import { setupMountedComponents } from '../../lib/testUtils'
import ScoreDisplay from './ScoreDisplay.vue'

describe.concurrent('ScoreDisplay.vue', async () => {
it('renders the ScoreDisplay with default props', async () => {
// arrange:
const { wrapper } = await setupMountedComponents(
{ component: ScoreDisplay },
{
props: {
rangeLower: 0,
rangeUpper: 1,
value: 0.5
}
}
)

// act: nothing, only test rendering

// assert:
const svg = wrapper.find('svg')
expect(svg.exists()).toBe(true)
})
})
Loading
Loading