Skip to content

Commit d508d10

Browse files
committed
fix(bullet): fix broken tests
1 parent e9ba49e commit d508d10

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/bullet/src/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export const useEnhancedData = (
1919
const min = Math.min(...all, 0)
2020

2121
const scale = createLinearScale(
22-
{ reverse, type: 'linear' },
22+
{ type: 'linear' },
2323
{ all, max, min },
2424
layout === 'horizontal' ? width : height,
25-
layout === 'horizontal' ? 'x' : 'y'
25+
layout === 'horizontal' ? (reverse ? 'y' : 'x') : reverse ? 'x' : 'y'
2626
)
2727

2828
return {

packages/bullet/tests/Bullet.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Bullet', () => {
6262
expect(
6363
ticks.map(el => el.prop('animatedProps').transform.get()).join('; ')
6464
).toMatchInlineSnapshot(
65-
`"translate(0,0); translate(37.5,0); translate(75,0); translate(112.5,0); translate(150,0); translate(187.5,0); translate(225,0); translate(262.5,0); translate(300,0)"`
65+
`"translate(0,0); translate(38,0); translate(75,0); translate(113,0); translate(150,0); translate(188,0); translate(225,0); translate(263,0); translate(300,0)"`
6666
)
6767
expect(items.at(1).prop('x')).toEqual(0)
6868
expect(items.at(1).prop('y')).toEqual(110)
@@ -86,7 +86,7 @@ describe('Bullet', () => {
8686
expect(
8787
ticks.map(el => el.prop('animatedProps').transform.get()).join('; ')
8888
).toMatchInlineSnapshot(
89-
`"translate(300,0); translate(262.5,0); translate(225,0); translate(187.5,0); translate(150,0); translate(112.5,0); translate(75,0); translate(37.5,0); translate(0,0)"`
89+
`"translate(300,0); translate(263,0); translate(225,0); translate(188,0); translate(150,0); translate(113,0); translate(75,0); translate(38,0); translate(0,0)"`
9090
)
9191
expect(items.at(1).prop('x')).toEqual(0)
9292
expect(items.at(1).prop('y')).toEqual(110)

0 commit comments

Comments
 (0)