From ae5ae68cd2ec4b5b66ae26e58de34b660151d1ca Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Tue, 30 Jan 2024 10:32:30 +0100 Subject: [PATCH] feat: adding StrucvarToolsCard (#42) --- .../StrucvarToolsCard.spec.ts | 37 ++++ .../StrucvarToolsCard/StrucvarToolsCard.vue | 178 ++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 src/components/StrucvarToolsCard/StrucvarToolsCard.spec.ts create mode 100644 src/components/StrucvarToolsCard/StrucvarToolsCard.vue diff --git a/src/components/StrucvarToolsCard/StrucvarToolsCard.spec.ts b/src/components/StrucvarToolsCard/StrucvarToolsCard.spec.ts new file mode 100644 index 0000000..a5c0ada --- /dev/null +++ b/src/components/StrucvarToolsCard/StrucvarToolsCard.spec.ts @@ -0,0 +1,37 @@ +import { describe, expect, it } from 'vitest' + +import { type Strucvar } from '../../lib/genomicVars' +import { setupMountedComponents } from '../../lib/testUtils' +import StrucvarToolsCard from './StrucvarToolsCard.vue' + +/** Example Strucvar */ +const strucvarInfo: Strucvar = { + genomeBuild: 'grch37', + svType: 'DEL', + chrom: '17', + start: 41176312, + stop: 41277500, + userRepr: 'DEL-grch37-17-41176312-41277500' +} + +describe.concurrent('StrucvarToolsCard.vue', async () => { + it('renders content', async () => { + // arrange: + const { wrapper } = await setupMountedComponents( + { component: StrucvarToolsCard }, + { + props: { + strucvar: structuredClone(strucvarInfo), + genomeBuild: 'grch37' + } + } + ) + + // act: nothing, only test rendering + + // assert: + expect(wrapper.text()).toContain('Variant Tools') + const vButtons = wrapper.findAllComponents({ name: 'VBtn' }) + expect(vButtons.length).toBe(7) + }) +}) diff --git a/src/components/StrucvarToolsCard/StrucvarToolsCard.vue b/src/components/StrucvarToolsCard/StrucvarToolsCard.vue new file mode 100644 index 0000000..17f9446 --- /dev/null +++ b/src/components/StrucvarToolsCard/StrucvarToolsCard.vue @@ -0,0 +1,178 @@ + + + + +