Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 16, 2025
1 parent 2087845 commit 189f270
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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]' : ''
}`
Expand Down
26 changes: 24 additions & 2 deletions products/jbrowse-web/src/tests/LGVSynteny.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 189f270

Please sign in to comment.