Skip to content

Commit

Permalink
Update snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jul 11, 2022
1 parent be13a81 commit 319e1a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/linear-genome-view/src/LinearGenomeView/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ test('can navToMultiple', () => {
{ refName: 'ctgA', start: 5000, end: 10000 },
{ refName: 'ctgC', start: 0, end: 5000 },
])
expect(model.offsetPx).toBe(2799)
expect(model.offsetPx).toBe(2793)
expect(model.bpPerPx).toBeCloseTo(12.531)
})

Expand Down Expand Up @@ -423,7 +423,8 @@ describe('Zoom to selected displayed regions', () => {
},
)
// offsetPx is still 0 since we are starting from the first coord
expect(model.offsetPx).toBe(0)
// needed Math.abs since it was giving negative-zero (-0)
expect(Math.abs(model.offsetPx)).toEqual(0)
// endOffset 19000 - (-1) = 19001 / 800 = zoomTo(23.75)
expect(model.bpPerPx).toBeCloseTo(23.75)
expect(model.bpPerPx).toBeLessThan(largestBpPerPx)
Expand Down Expand Up @@ -533,7 +534,7 @@ test('can instantiate a model that >2 regions', () => {
{ refName: 'ctgB', index: 1, offset: 0, start: 0, end: 10000 },
{ refName: 'ctgC', index: 2, offset: 0, start: 0, end: 10000 },
)
expect(model.offsetPx).toEqual(10000 / model.bpPerPx + 2)
expect(model.offsetPx).toEqual(10000 / model.bpPerPx)
expect(model.displayedRegionsTotalPx).toEqual(30000 / model.bpPerPx)
model.showAllRegions()
expect(model.offsetPx).toEqual(-40)
Expand Down

0 comments on commit 319e1a1

Please sign in to comment.