From 189f270857627a5db851c63f1f5902b71c74fff7 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 16 Jan 2025 05:36:27 -0800 Subject: [PATCH] More tests --- .../SequenceFeatureDetails/types.ts | 9 ++++++ .../src/LGVSyntenyDisplay/components/util.ts | 1 - .../jbrowse-web/src/tests/LGVSynteny.test.tsx | 26 ++++++++++++++++-- ...to-synteny-from-feature-details-1-snap.png | Bin 0 -> 1960 bytes ...nav-to-synteny-from-right-click-1-snap.png | Bin 0 -> 2810 bytes 5 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 packages/core/BaseFeatureWidget/SequenceFeatureDetails/types.ts create mode 100644 products/jbrowse-web/src/tests/__image_snapshots__/lgv-synteny-test-tsx-nav-to-synteny-from-feature-details-1-snap.png create mode 100644 products/jbrowse-web/src/tests/__image_snapshots__/lgv-synteny-test-tsx-nav-to-synteny-from-right-click-1-snap.png diff --git a/packages/core/BaseFeatureWidget/SequenceFeatureDetails/types.ts b/packages/core/BaseFeatureWidget/SequenceFeatureDetails/types.ts new file mode 100644 index 0000000000..230582a836 --- /dev/null +++ b/packages/core/BaseFeatureWidget/SequenceFeatureDetails/types.ts @@ -0,0 +1,9 @@ +import type { SequenceFeatureDetailsModel } from './model' +import type { SimpleFeatureSerialized } from '../../util' +import type { SeqState } from '../util' + +export interface SequencePanelProps { + sequence: SeqState + feature: SimpleFeatureSerialized + model: SequenceFeatureDetailsModel +} diff --git a/plugins/linear-comparative-view/src/LGVSyntenyDisplay/components/util.ts b/plugins/linear-comparative-view/src/LGVSyntenyDisplay/components/util.ts index 6cd4370ea1..1555e48934 100644 --- a/plugins/linear-comparative-view/src/LGVSyntenyDisplay/components/util.ts +++ b/plugins/linear-comparative-view/src/LGVSyntenyDisplay/components/util.ts @@ -117,7 +117,6 @@ export async function navToSynteny({ const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}` const m1 = Math.min(rMateStart, rMateEnd) const m2 = Math.max(rMateStart, rMateEnd) - console.log(m1, m2) const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${ horizontallyFlip ? '[rev]' : '' }` diff --git a/products/jbrowse-web/src/tests/LGVSynteny.test.tsx b/products/jbrowse-web/src/tests/LGVSynteny.test.tsx index b7e73ff23b..72133863d3 100644 --- a/products/jbrowse-web/src/tests/LGVSynteny.test.tsx +++ b/products/jbrowse-web/src/tests/LGVSynteny.test.tsx @@ -20,7 +20,7 @@ beforeEach(() => { const delay = { timeout: 5000 } const opts = [{}, delay] -test('nav to synteny', async () => { +test('nav to synteny from right click', async () => { const user = userEvent.setup() const { session, view, findByTestId, findByText, findAllByTestId } = await createView() @@ -38,6 +38,28 @@ test('nav to synteny', async () => { expect(v?.initialized).toBe(true) expect(v?.views[0]?.coarseVisibleLocStrings).toBe('ctgA:29,221..34,669') }, delay) - await new Promise(res => setTimeout(res, 1000)) + expectCanvasMatch(await findByTestId('synteny_canvas', ...opts)) +}, 60000) + +test('nav to synteny from feature details', async () => { + const user = userEvent.setup() + const { session, view, findByTestId, findByText, findAllByTestId } = + await createView() + + await view.navToLocString('ctgA:30,222..33,669') + await user.click(await findByTestId(hts('volvox_ins.paf'), ...opts)) + + const track = await findAllByTestId('pileup-overlay-strand') + fireEvent.mouseMove(track[0]!, { clientX: 200, clientY: 5 }) + fireEvent.click(track[0]!, { clientX: 200, clientY: 5 }) + fireEvent.click( + await findByText('Launch new linear synteny view on this feature'), + ) + fireEvent.click(await findByText('Submit')) + await waitFor(() => { + const v = session.views[1] as LinearSyntenyViewModel | undefined + expect(v?.initialized).toBe(true) + expect(v?.views[0]?.coarseVisibleLocStrings).toBe('ctgA:1..50,001') + }, delay) expectCanvasMatch(await findByTestId('synteny_canvas', ...opts)) }, 60000) diff --git a/products/jbrowse-web/src/tests/__image_snapshots__/lgv-synteny-test-tsx-nav-to-synteny-from-feature-details-1-snap.png b/products/jbrowse-web/src/tests/__image_snapshots__/lgv-synteny-test-tsx-nav-to-synteny-from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ibd2Y5jZFmk3+YHjp7=t?ef#m`bIv_OZfZW9MW+g?XiR(U&)fpr(s6 zst9iTc*|l%9(7U|tCs_hZ6X)i4^cmHBP6Dx0= zPJ|5oj-dT)TbOie(2Ui#GbBTjzx%PdI$aw3{prhC{;0&aBxTy{tke*1qXijVxAjxb z`lMCE4Vb<=VS$t$8jw%)`%LaB;MneEVe7Y{nR;gAxEi(-z0EgNtifJKr@A0Fxvh1^ zu)BxjUaDJyp@_pI{u?eBujdF{oLrEod}B_V6Uu6#EVs~_IV0ujdcOsY z$}Pbll)m&Rsxj52ezHORpo+%X1f3vo?01F~e-BAup0j89+ttLKt&m-U zdr9XGyAy!@(xV207K8XGEu$%vsc_o>cn=@A?vcFOy+85|W@rj$^UE>3+q*iJ7@Y9mWeL4TB{49E#4x(?9GYUVOJ|2@M# SQe}<)dI8PL-?P@8o%ug4$Ufl! literal 0 HcmV?d00001 diff --git a/products/jbrowse-web/src/tests/__image_snapshots__/lgv-synteny-test-tsx-nav-to-synteny-from-right-click-1-snap.png b/products/jbrowse-web/src/tests/__image_snapshots__/lgv-synteny-test-tsx-nav-to-synteny-from-right-click-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..439664cf1a31c9c9b4bf04b380deec7742fff0ae GIT binary patch literal 2810 zcmYM02~bn#8io^=uuBMFA*et&0R`CtsL0~NVL7ZzQ z|K7)7iyf;LOb}EssDi^IH)iF&gI;SzuB~BN?}Y&u)>c`6l{D6^iW7#UCqz5R;>d@X*;6@j^k_ zg?x7YQNnTI7Vdl%-yelIEG#@UJ8nE^X5%0Ts#BwcK{=yjq|Pv`5#o%h%5Pw~sTpDn z@vEpxhRJ}Ltq<|pHA@8b=vK`Y46YXVUh7>bwc739Rt5;dvb*;y1w%>jRIbQ{Fy5p|MgrS@y-1d()O0O$gzYRpG#>NA!Ko@I zcL*UWSs0-c;{?{x{fnJSpq{Gshr{Z(`^WfXWN2#$mYaOah2lh?F~~S~(u0vLGO3oG zr@;fF^}PV1sh_@n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