Skip to content

Commit 4e85bd3

Browse files
committed
Updates
1 parent 60d0a62 commit 4e85bd3

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

packages/core/src/util/tracks.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { getParent, isRoot, isStateTreeNode } from '@jbrowse/mobx-state-tree'
1+
import {
2+
getParent,
3+
getSnapshot,
4+
isRoot,
5+
isStateTreeNode,
6+
} from '@jbrowse/mobx-state-tree'
27

38
import {
49
getFileHandle,
@@ -521,9 +526,13 @@ export function showTrackGeneric(
521526
}
522527

523528
// Allow plugins to preprocess the track config (e.g. to add default displays)
529+
// Use getSnapshot for MST models, structuredClone for plain objects
530+
const confSnapshot = isStateTreeNode(rawConf)
531+
? getSnapshot(rawConf)
532+
: structuredClone(rawConf)
524533
const conf = pluginManager.evaluateExtensionPoint(
525534
'Core-preProcessTrackConfig',
526-
structuredClone(rawConf),
535+
confSnapshot,
527536
) as typeof rawConf
528537

529538
const trackType = pluginManager.getTrackType(conf.type)
109 KB
Loading

products/jbrowse-web/browser-tests/runner.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,14 @@ const testSuites: TestSuite[] = [
317317
],
318318
}
319319

320-
const specParam = JSON.stringify(sessionSpec)
320+
const specParam = encodeURIComponent(JSON.stringify(sessionSpec))
321321
const url = `http://localhost:${PORT}/?config=test_data/volvox/config.json&session=spec-${specParam}`
322+
console.log({ url })
322323
await page.goto(url, { waitUntil: 'networkidle0', timeout: 60000 })
323324

324325
await findByText(page, 'ctgA')
325-
await findByTestId(page, 'stack-canvas', 60000)
326+
// The UMD plugin adds LinearReadCloudDisplay with drawCloud:true for _sv tracks
327+
await findByTestId(page, 'cloud-canvas', 60000)
326328
await waitForLoadingToComplete(page)
327329
await delay(1000)
328330
await snapshot(page, 'session-spec-display-snapshot-type')
@@ -678,6 +680,17 @@ const testSuites: TestSuite[] = [
678680
await snapshot(page, 'alignments-bam')
679681
},
680682
},
683+
{
684+
name: 'volvox_sv track screenshot',
685+
fn: async page => {
686+
await navigateToApp(page)
687+
await openTrack(page, 'volvox_sv')
688+
// The UMD plugin adds LinearReadCloudDisplay with drawCloud:true for _sv tracks
689+
await findByTestId(page, 'cloud-canvas', 60000)
690+
await waitForLoadingToComplete(page)
691+
await snapshot(page, 'alignments-volvox-sv')
692+
},
693+
},
681694
],
682695
},
683696
{

0 commit comments

Comments
 (0)