Skip to content

Commit

Permalink
Update snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 30, 2025
1 parent 015769c commit 15064c9
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 1,405 deletions.
14 changes: 4 additions & 10 deletions packages/web-core/src/BaseWebSession/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ import CopyIcon from '@mui/icons-material/FileCopy'
import InfoIcon from '@mui/icons-material/Info'
import SettingsIcon from '@mui/icons-material/Settings'
import { autorun } from 'mobx'
import {
addDisposer,
cast,
getParent,
getSnapshot,
types,
} from 'mobx-state-tree'
import { addDisposer, cast, getParent, types } from 'mobx-state-tree'

import { WebSessionConnectionsMixin } from '../SessionConnections'

Expand Down Expand Up @@ -403,13 +397,13 @@ export function BaseWebSession({
priority: 999,
disabled: isRefSeq,
onClick: () => {
const snap = structuredClone(getSnapshot(config)) as {
const snap = structuredClone(config) as {
[key: string]: unknown
displays: Display[]
displays?: Display[]
}
const now = Date.now()
snap.trackId += `-${now}`
snap.displays.forEach(display => {
snap.displays?.forEach(display => {
display.displayId += `-${now}`
})
// the -sessionTrack suffix to trackId is used as metadata for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function facetedStateTreeF() {
) as string,
adapter: readConfObject(track, 'adapter')?.type as string,
description: readConfObject(track, 'description') as string,
metadata: (track.metadata || {}) as Record<string, unknown>,
metadata: (track.metadata || {}) as Record<string, unknown>,
}) as const,
)
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
hideTrackGeneric,
showTrackGeneric,
toggleTrackGeneric,
} from '@jbrowse/core/util/tracks'
import { ElementId } from '@jbrowse/core/util/types/mst'
import { getParent, types } from 'mobx-state-tree'

import type PluginManager from '@jbrowse/core/PluginManager'
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
import type { Instance } from 'mobx-state-tree'
import {
hideTrackGeneric,
showTrackGeneric,
toggleTrackGeneric,
} from '@jbrowse/core/util/tracks'

export function linearSyntenyViewHelperModelFactory(
pluginManager: PluginManager,
Expand Down
2 changes: 1 addition & 1 deletion products/jbrowse-desktop/src/rootModel/rootModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test('adds track and connection configs to an assembly', () => {
type: 'FeatureTrack',
trackId: 'trackId0',
})
expect(getSnapshot(newTrackConf)).toMatchSnapshot()
expect(newTrackConf).toMatchSnapshot()
expect(root.jbrowse.tracks.length).toBe(1)
const newConnectionConf = root.jbrowse.addConnectionConf({
type: 'JBrowse1Connection',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,6 @@ exports[`adds track and connection configs to an assembly 1`] = `

exports[`adds track and connection configs to an assembly 2`] = `
{
"displays": [
{
"displayId": "trackId0-LinearBasicDisplay",
"type": "LinearBasicDisplay",
},
{
"displayId": "trackId0-LinearArcDisplay",
"type": "LinearArcDisplay",
},
],
"trackId": "trackId0",
"type": "FeatureTrack",
}
Expand Down
2 changes: 1 addition & 1 deletion products/jbrowse-react-app/src/rootModel/rootModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test('adds track and connection configs to an assembly', () => {
type: 'FeatureTrack',
trackId: 'trackId0',
})
expect(getSnapshot(newTrackConf)).toMatchSnapshot()
expect(newTrackConf).toMatchSnapshot()
expect(root.jbrowse.tracks.length).toBe(1)
const newConnectionConf = root.jbrowse.addConnectionConf({
type: 'JBrowse1Connection',
Expand Down
Loading

0 comments on commit 15064c9

Please sign in to comment.