Skip to content

Commit

Permalink
feat: adding SeqvarScoresCard (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Jan 30, 2024
1 parent 99ceaee commit 931aeec
Show file tree
Hide file tree
Showing 10 changed files with 1,523 additions and 7 deletions.
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

0 comments on commit 931aeec

Please sign in to comment.