diff --git a/products/jbrowse-web/src/tests/VcfMatrix.test.tsx b/products/jbrowse-web/src/tests/VcfMatrix.test.tsx index fd6020fdd1..0f44111653 100644 --- a/products/jbrowse-web/src/tests/VcfMatrix.test.tsx +++ b/products/jbrowse-web/src/tests/VcfMatrix.test.tsx @@ -23,7 +23,7 @@ test('matrix', async () => { expectCanvasMatch(await findByTestId(/prerendered_canvas/, ...opts)) }, 40000) -test('matrix phased', async () => { +test('mphased', async () => { const { view, findByTestId, findByText } = await createView() await view.navToLocString('ctgA') fireEvent.click(await findByTestId(hts('volvox_test_vcf'), ...opts)) @@ -38,33 +38,3 @@ test('matrix phased', async () => { fireEvent.click(await findByText('Force load', ...opts)) expectCanvasMatch(await findByTestId(/prerendered_canvas/, ...opts)) }, 40000) - -test('regular', async () => { - const { view, findByTestId, findByText, findAllByTestId } = await createView() - - await view.navToLocString('ctgA') - fireEvent.click(await findByTestId(hts('volvox_test_vcf'), ...opts)) - - fireEvent.click(await findByTestId('track_menu_icon', ...opts)) - fireEvent.click(await findByText('Display types', ...opts)) - fireEvent.click(await findByText('Multi-variant display (regular)', ...opts)) - fireEvent.click(await findByText('Force load', ...opts)) - expectCanvasMatch((await findAllByTestId(/prerendered_canvas/, ...opts))[0]!) -}, 40000) - -test('regular phased', async () => { - const { view, findByTestId, findByText, findAllByTestId } = await createView() - - await view.navToLocString('ctgA') - fireEvent.click(await findByTestId(hts('volvox_test_vcf'), ...opts)) - - fireEvent.click(await findByTestId('track_menu_icon', ...opts)) - fireEvent.click(await findByText('Display types', ...opts)) - fireEvent.click(await findByText('Multi-variant display (regular)', ...opts)) - - // Using the track menu twice not working currently, manually poke this setting - view.tracks[0].displays[0].setPhasedMode('phased') - - fireEvent.click(await findByText('Force load', ...opts)) - expectCanvasMatch((await findAllByTestId(/prerendered_canvas/, ...opts))[0]!) -}, 40000) diff --git a/products/jbrowse-web/src/tests/VcfMatrixRegular.test.tsx b/products/jbrowse-web/src/tests/VcfMatrixRegular.test.tsx new file mode 100644 index 0000000000..a3ada36117 --- /dev/null +++ b/products/jbrowse-web/src/tests/VcfMatrixRegular.test.tsx @@ -0,0 +1,44 @@ +import { fireEvent } from '@testing-library/react' + +import { createView, doBeforeEach, expectCanvasMatch, hts, setup } from './util' + +setup() + +beforeEach(() => { + doBeforeEach() +}) + +const delay = { timeout: 30000 } +const opts = [{}, delay] + +test('regular', async () => { + const { view, findByTestId, findByText, findAllByTestId } = await createView() + + await view.navToLocString('ctgA') + fireEvent.click(await findByTestId(hts('volvox_test_vcf'), ...opts)) + + fireEvent.click(await findByTestId('track_menu_icon', ...opts)) + fireEvent.click(await findByText('Display types', ...opts)) + fireEvent.click(await findByText('Multi-variant display (regular)', ...opts)) + await new Promise(res => setTimeout(res, 1000)) + fireEvent.click(await findByText('Force load', ...opts)) + + expectCanvasMatch((await findAllByTestId(/prerendered_canvas/, ...opts))[0]!) +}, 40000) + +test('rphased', async () => { + const { view, findByTestId, findByText, findAllByTestId } = await createView() + + await view.navToLocString('ctgA') + fireEvent.click(await findByTestId(hts('volvox_test_vcf'), ...opts)) + + fireEvent.click(await findByTestId('track_menu_icon', ...opts)) + fireEvent.click(await findByText('Display types', ...opts)) + fireEvent.click(await findByText('Multi-variant display (regular)', ...opts)) + + // Using the track menu twice not working currently, manually poke this setting + view.tracks[0].displays[0].setPhasedMode('phased') + + fireEvent.click(await findByText('Force load', ...opts)) + expectCanvasMatch((await findAllByTestId(/prerendered_canvas/, ...opts))[0]!) +}, 40000) diff --git a/products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-regular-1-snap.png b/products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-regular-test-tsx-regular-1-snap.png similarity index 100% rename from products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-regular-1-snap.png rename to products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-regular-test-tsx-regular-1-snap.png diff --git a/products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-regular-phased-1-snap.png b/products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-regular-test-tsx-rphased-1-snap.png similarity index 100% rename from products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-regular-phased-1-snap.png rename to products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-regular-test-tsx-rphased-1-snap.png diff --git a/products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-matrix-phased-1-snap.png b/products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-mphased-1-snap.png similarity index 100% rename from products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-matrix-phased-1-snap.png rename to products/jbrowse-web/src/tests/__image_snapshots__/vcf-matrix-test-tsx-mphased-1-snap.png