diff --git a/cases/vueapp/src/common.js b/cases/vueapp/src/common.js index 678297417..eb0673547 100644 --- a/cases/vueapp/src/common.js +++ b/cases/vueapp/src/common.js @@ -55,7 +55,7 @@ export const connectTopRowControls = () => { ) } const elem = $('#vueapp-filtration-complexity-mode') - if (elem) { + if (elem && elem.val(newValue)) { elem.val(newValue).change() } } diff --git a/cases/vueapp/tests/unit/cases/CaseListPaneCases.spec.js b/cases/vueapp/tests/unit/cases/CaseListPaneCases.spec.js index a9e22ba85..fe29cbda4 100644 --- a/cases/vueapp/tests/unit/cases/CaseListPaneCases.spec.js +++ b/cases/vueapp/tests/unit/cases/CaseListPaneCases.spec.js @@ -30,7 +30,7 @@ describe('CaseListPaneCases.vue', () => { // Disable warnings vi.spyOn(console, 'warn').mockImplementation(vi.fn()) // Set reproducible time - vi.useFakeTimers('modern') + vi.useFakeTimers() vi.setSystemTime(new Date(2020, 3, 1)) }) diff --git a/clinvar_export/vueapp/tests/unit/clinvarExport/SubmissionSetList.spec.js b/clinvar_export/vueapp/tests/unit/clinvarExport/SubmissionSetList.spec.js index f6532d7e4..7151ca594 100644 --- a/clinvar_export/vueapp/tests/unit/clinvarExport/SubmissionSetList.spec.js +++ b/clinvar_export/vueapp/tests/unit/clinvarExport/SubmissionSetList.spec.js @@ -48,7 +48,7 @@ describe('SubmissionSetList.vue', () => { // Disable warnings vi.spyOn(console, 'warn').mockImplementation(vi.fn()) // Set reproducible time - vi.useFakeTimers('modern') + vi.useFakeTimers() vi.setSystemTime(new Date(2020, 3, 1)) // Mock out jquery dollar function for showing modals global.$ = vi.fn() diff --git a/clinvar_export/vueapp/tests/unit/clinvarExport/store.actions.spec.js b/clinvar_export/vueapp/tests/unit/clinvarExport/store.actions.spec.js index 8302bc8c8..189d8a243 100644 --- a/clinvar_export/vueapp/tests/unit/clinvarExport/store.actions.spec.js +++ b/clinvar_export/vueapp/tests/unit/clinvarExport/store.actions.spec.js @@ -62,7 +62,7 @@ describe('actions', () => { // Disable warnings vi.spyOn(console, 'warn').mockImplementation(vi.fn()) // Set reproducible time - vi.useFakeTimers('modern') + vi.useFakeTimers() vi.setSystemTime(new Date(2020, 3, 1)) }) diff --git a/svs/vueapp/src/components/SvFilterResultsTable.vue b/svs/vueapp/src/components/SvFilterResultsTable.vue index 9da0dc26c..e3ad17240 100644 --- a/svs/vueapp/src/components/SvFilterResultsTable.vue +++ b/svs/vueapp/src/components/SvFilterResultsTable.vue @@ -1,5 +1,5 @@ diff --git a/varfish/vueapp/src/varfish/components/VariantDetailsFlags.vue b/varfish/vueapp/src/varfish/components/VariantDetailsFlags.vue index d11286f73..364c52a90 100644 --- a/varfish/vueapp/src/varfish/components/VariantDetailsFlags.vue +++ b/varfish/vueapp/src/varfish/components/VariantDetailsFlags.vue @@ -14,7 +14,7 @@ const props = defineProps({ /** Whether to show the overlay. */ const overlayShow = computed( - () => (props.flagsStore?.serverInteractions ?? 0) > 0 + () => (props.flagsStore?.serverInteractions ?? 0) > 0, ) const flagsToSubmit = ref(copy({ ...props.flagsStore.initialFlagsTemplate })) @@ -80,7 +80,7 @@ const resetFlags = () => { const onSubmitFlags = async () => { const flagsToSubmitEmpty = isEqual( flagsToSubmit.value, - props.flagsStore.emptyFlagsTemplate + props.flagsStore.emptyFlagsTemplate, ) if (props.flagsStore.flags && flagsToSubmitEmpty) { // IS not empty but SHOULD be empty, so delete the flags diff --git a/varfish/vueapp/src/varfish/helpers.js b/varfish/vueapp/src/varfish/helpers.js index efcb3f0dc..62963baec 100644 --- a/varfish/vueapp/src/varfish/helpers.js +++ b/varfish/vueapp/src/varfish/helpers.js @@ -26,7 +26,7 @@ export function bndInsOverlap(lhs, rhs, radius) { start: lhs.start - radius, end: lhs.start + radius, }, - { chromosome: rhs.chromosome, start: rhs.start, end: rhs.start + 1 } + { chromosome: rhs.chromosome, start: rhs.start, end: rhs.start + 1 }, ) > 0 ) } @@ -35,7 +35,7 @@ export function reciprocalOverlap(lhs, rhs) { const overlap = overlapLength(lhs, rhs) return Math.min( overlap / (rhs.end - rhs.start + 1), - overlap / (lhs.end - lhs.start + 1) + overlap / (lhs.end - lhs.start + 1), ) } diff --git a/varfish/vueapp/src/varfish/more-utils.ts b/varfish/vueapp/src/varfish/more-utils.ts index abe1cb647..a615094ed 100644 --- a/varfish/vueapp/src/varfish/more-utils.ts +++ b/varfish/vueapp/src/varfish/more-utils.ts @@ -10,7 +10,7 @@ export const roundIt = ( value: number, digits: number = 2, - label?: string + label?: string, ): string => { if (!value) { return `NaN` diff --git a/variants/vueapp/src/components/VariantDetailsAcmgRating.stories.js b/variants/vueapp/src/components/VariantDetailsAcmgRating.stories.js index 895a8b5aa..00b4f1ea6 100644 --- a/variants/vueapp/src/components/VariantDetailsAcmgRating.stories.js +++ b/variants/vueapp/src/components/VariantDetailsAcmgRating.stories.js @@ -4,7 +4,7 @@ import trioVariantsData from '@variantsTest/data/variants-trio.json' import VariantDetailsAcmgRating from './VariantDetailsAcmgRating.vue' export default { - title: 'Variants / Small Variant Details Calls', + title: 'Variants / Small Variant Details ACMG', component: VariantDetailsAcmgRating, } diff --git a/variants/vueapp/src/components/VariantDetailsExtraAnnos.stories.js b/variants/vueapp/src/components/VariantDetailsExtraAnnos.stories.js deleted file mode 100644 index 8428d5e93..000000000 --- a/variants/vueapp/src/components/VariantDetailsExtraAnnos.stories.js +++ /dev/null @@ -1,24 +0,0 @@ -import VariantDetailsExtraAnnos from './VariantDetailsExtraAnnos.vue' - -export default { - title: 'Variants / Small Variant Details Extra Annos', - component: VariantDetailsExtraAnnos, -} - -const Template = (args) => ({ - components: { VariantDetailsExtraAnnos }, - setup() { - return { args } - }, - template: - '', -}) - -export const Example = Template.bind({}) -Example.args = { - extraAnnos: { - annotations: { anno1: 123, anno2: 456 }, - }, -} diff --git a/variants/vueapp/src/components/VariantDetailsFreqsAutosomal.vue b/variants/vueapp/src/components/VariantDetailsFreqsAutosomal.vue index 78bc2d300..b89553ed5 100644 --- a/variants/vueapp/src/components/VariantDetailsFreqsAutosomal.vue +++ b/variants/vueapp/src/components/VariantDetailsFreqsAutosomal.vue @@ -12,7 +12,11 @@ const props = defineProps<{ const FREQ_DIGITS = 5 const selAnnos = computed(() => { - return props.varAnnos[props.dataset] + if (!props.varAnnos) { + return null + } else { + return props.varAnnos[props.dataset] + } }) const noCohort = computed(() => { diff --git a/variants/vueapp/tests/unit/components/FilterFormEffectPane.spec.js b/variants/vueapp/tests/unit/components/FilterFormEffectPane.spec.js index 3d16c458e..a131313a3 100644 --- a/variants/vueapp/tests/unit/components/FilterFormEffectPane.spec.js +++ b/variants/vueapp/tests/unit/components/FilterFormEffectPane.spec.js @@ -122,7 +122,7 @@ describe('FilterFormEffectPane.vue', () => { await input.setValue('123') - expect(input.element.value).toBe(123) + expect(input.element.value).toBe("123") }) test('effects detailed', async () => { diff --git a/variants/vueapp/tests/unit/components/FilterFormFrequencyPane.spec.js b/variants/vueapp/tests/unit/components/FilterFormFrequencyPane.spec.js index b957b18a8..353ac0d89 100644 --- a/variants/vueapp/tests/unit/components/FilterFormFrequencyPane.spec.js +++ b/variants/vueapp/tests/unit/components/FilterFormFrequencyPane.spec.js @@ -56,20 +56,20 @@ describe('FilterFormFrequencyPane.vue', () => { expect(inputs[35].element.checked).toBeFalsy() // Check homozygous count - expect(inputs[1].element.value).toBe(0) - expect(inputs[6].element.value).toBe(0) - expect(inputs[11].element.value).toBe(0) - expect(inputs[16].element.value).toBe(0) + expect(inputs[1].element.value).toBe("0") + expect(inputs[6].element.value).toBe("0") + expect(inputs[11].element.value).toBe("0") + expect(inputs[16].element.value).toBe("0") expect(inputs[21].element.value).toBe('') - expect(inputs[26].element.value).toBe(10) - expect(inputs[31].element.value).toBe(200) + expect(inputs[26].element.value).toBe("10") + expect(inputs[31].element.value).toBe("200") expect(inputs[36].element.value).toBe('') // Check heterozygous count - expect(inputs[2].element.value).toBe(4) - expect(inputs[7].element.value).toBe(10) - expect(inputs[12].element.value).toBe(20) - expect(inputs[17].element.value).toBe(4) + expect(inputs[2].element.value).toBe("4") + expect(inputs[7].element.value).toBe("10") + expect(inputs[12].element.value).toBe("20") + expect(inputs[17].element.value).toBe("4") expect(inputs[22].element.value).toBe('') expect(inputs[27].element.disabled).toBeTruthy() expect(inputs[32].element.value).toBe('') @@ -86,13 +86,13 @@ describe('FilterFormFrequencyPane.vue', () => { expect(inputs[38].element.disabled).toBeTruthy() // Check frequency - expect(inputs[4].element.value).toBe(0.002) - expect(inputs[9].element.value).toBe(0.002) - expect(inputs[14].element.value).toBe(0.002) - expect(inputs[19].element.value).toBe(0.002) - expect(inputs[24].element.value).toBe(20) - expect(inputs[29].element.value).toBe(0.01) - expect(inputs[34].element.value).toBe(0.01) + expect(inputs[4].element.value).toBe("0.002") + expect(inputs[9].element.value).toBe("0.002") + expect(inputs[14].element.value).toBe("0.002") + expect(inputs[19].element.value).toBe("0.002") + expect(inputs[24].element.value).toBe("20") + expect(inputs[29].element.value).toBe("0.01") + expect(inputs[34].element.value).toBe("0.01") expect(inputs[39].element.value).toBe('') }) @@ -147,14 +147,14 @@ describe('FilterFormFrequencyPane.vue', () => { await inputs[31].setValue(123) await inputs[36].setValue(123) - expect(inputs[1].element.value).toBe(123) - expect(inputs[6].element.value).toBe(123) - expect(inputs[11].element.value).toBe(123) - expect(inputs[16].element.value).toBe(123) - expect(inputs[21].element.value).toBe(123) - expect(inputs[26].element.value).toBe(123) - expect(inputs[31].element.value).toBe(123) - expect(inputs[36].element.value).toBe(123) + expect(inputs[1].element.value).toBe("123") + expect(inputs[6].element.value).toBe("123") + expect(inputs[11].element.value).toBe("123") + expect(inputs[16].element.value).toBe("123") + expect(inputs[21].element.value).toBe("123") + expect(inputs[26].element.value).toBe("123") + expect(inputs[31].element.value).toBe("123") + expect(inputs[36].element.value).toBe("123") }) test('frequency change heterozygous count', async () => { @@ -175,12 +175,12 @@ describe('FilterFormFrequencyPane.vue', () => { await inputs[22].setValue(123) await inputs[32].setValue(123) - expect(inputs[2].element.value).toBe(123) - expect(inputs[7].element.value).toBe(123) - expect(inputs[12].element.value).toBe(123) - expect(inputs[17].element.value).toBe(123) - expect(inputs[22].element.value).toBe(123) - expect(inputs[32].element.value).toBe(123) + expect(inputs[2].element.value).toBe("123") + expect(inputs[7].element.value).toBe('123') + expect(inputs[12].element.value).toBe("123") + expect(inputs[17].element.value).toBe("123") + expect(inputs[22].element.value).toBe("123") + expect(inputs[32].element.value).toBe("123") }) test('frequency change hemizygous count', async () => { @@ -200,11 +200,11 @@ describe('FilterFormFrequencyPane.vue', () => { await inputs[18].setValue(123) await inputs[23].setValue(123) - expect(inputs[3].element.value).toBe(123) - expect(inputs[8].element.value).toBe(123) - expect(inputs[13].element.value).toBe(123) - expect(inputs[18].element.value).toBe(123) - expect(inputs[23].element.value).toBe(123) + expect(inputs[3].element.value).toBe("123") + expect(inputs[8].element.value).toBe("123") + expect(inputs[13].element.value).toBe("123") + expect(inputs[18].element.value).toBe("123") + expect(inputs[23].element.value).toBe("123") }) test('frequency change frequency', async () => { @@ -227,14 +227,14 @@ describe('FilterFormFrequencyPane.vue', () => { await inputs[34].setValue(123) await inputs[39].setValue(123) - expect(inputs[4].element.value).toBe(123) - expect(inputs[9].element.value).toBe(123) - expect(inputs[14].element.value).toBe(123) - expect(inputs[19].element.value).toBe(123) - expect(inputs[24].element.value).toBe(123) - expect(inputs[29].element.value).toBe(123) - expect(inputs[34].element.value).toBe(123) - expect(inputs[39].element.value).toBe(123) + expect(inputs[4].element.value).toBe("123") + expect(inputs[9].element.value).toBe("123") + expect(inputs[14].element.value).toBe("123") + expect(inputs[19].element.value).toBe("123") + expect(inputs[24].element.value).toBe("123") + expect(inputs[29].element.value).toBe("123") + expect(inputs[34].element.value).toBe("123") + expect(inputs[39].element.value).toBe("123") }) test('frequency dev mode', async () => { diff --git a/variants/vueapp/tests/unit/components/FilterFormQualityPaneRow.spec.js b/variants/vueapp/tests/unit/components/FilterFormQualityPaneRow.spec.js index 618f91d23..7a8c85730 100644 --- a/variants/vueapp/tests/unit/components/FilterFormQualityPaneRow.spec.js +++ b/variants/vueapp/tests/unit/components/FilterFormQualityPaneRow.spec.js @@ -64,14 +64,13 @@ describe('FilterFormQualityPaneRow.vue', () => { await inputs[5].setValue(666) await select.setValue('ignore') - // TODO: bug in happy-dom or vue-test? The 0-th one is not set. + // TODO: bug in happy-dom or vue-test? The 0-th equals "10" // expect(inputs[0].element.value).toEqual('111') - expect(inputs[1].element.value).toEqual(222) - expect(inputs[2].element.value).toEqual(0.333) - expect(inputs[3].element.value).toEqual(444) - expect(inputs[4].element.value).toEqual(555) - expect(inputs[5].element.value).toEqual(666) - // TODO: Bug in happy-dom? Value is "" in tests. - // expect(select.element.value).toEqual('ignore') + expect(inputs[1].element.value).toEqual("222") + expect(inputs[2].element.value).toEqual("0.333") + expect(inputs[3].element.value).toEqual("444") + expect(inputs[4].element.value).toEqual("555") + expect(inputs[5].element.value).toEqual("666") + expect(select.element.value).toEqual('ignore') }) }) diff --git a/variants/vueapp/tests/unit/components/VariantDetailsExtraAnnos.spec.js b/variants/vueapp/tests/unit/components/VariantDetailsExtraAnnos.spec.js deleted file mode 100644 index f552379a5..000000000 --- a/variants/vueapp/tests/unit/components/VariantDetailsExtraAnnos.spec.js +++ /dev/null @@ -1,14 +0,0 @@ -// import VariantDetailsExtraAnnos from '@variants/components/VariantDetailsExtraAnnos.vue' -// import { shallowMount } from '@vue/test-utils' -import { describe, test } from 'vitest' - -describe('VariantDetailsExtraAnnos.vue', () => { - test('', () => { - // const wrapper = shallowMount(VariantDetailsExtraAnnos, { - // props: { - // params: {}, - // }, - // }) - // TODO [TEST_STUB] - }) -}) diff --git a/variants/vueapp/tests/unit/components/VariantDetailsTxCsq.spec.js b/variants/vueapp/tests/unit/components/VariantDetailsTxCsq.spec.js index 8e2ab9e25..d04d99031 100644 --- a/variants/vueapp/tests/unit/components/VariantDetailsTxCsq.spec.js +++ b/variants/vueapp/tests/unit/components/VariantDetailsTxCsq.spec.js @@ -17,7 +17,7 @@ describe('VariantDetailsTxCsq.vue', () => { test('transcripts disabled/empty', () => { const wrapper = shallowMount(VariantDetailsTxCsq, { props: { - effectDetails: null, + txCsq: null, }, })