test(ci): align challenge modal spring mock

This commit is contained in:
Tommaso Casaburi
2026-04-15 15:00:52 +07:00
parent 5059fd5a87
commit 20c0dd616e
@@ -65,14 +65,18 @@ vi.mock('../../../stores/use-challenges-store', () => ({
vi.mock('@react-spring/web', async () => { vi.mock('@react-spring/web', async () => {
const React = await vi.importActual<typeof import('react')>('react'); const React = await vi.importActual<typeof import('react')>('react');
const createSpringValue = (value: number) => ({
get: () => value,
to: (mapper: (input: number) => unknown) => mapper(value),
});
return { return {
animated: { animated: {
div: React.forwardRef(({ children, style, ...props }: any, ref) => createElement('div', { ...props, ref, style: { touchAction: style?.touchAction } }, children)), div: React.forwardRef(({ children, style, ...props }: any, ref) => createElement('div', { ...props, ref, style: { touchAction: style?.touchAction } }, children)),
}, },
useSpring: () => [ useSpring: () => [
{ {
x: { get: () => 120 }, x: createSpringValue(120),
y: { get: () => 60 }, y: createSpringValue(60),
}, },
{ start: testState.springStartMock }, { start: testState.springStartMock },
], ],