mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
test(ci): align challenge modal spring mock
This commit is contained in:
@@ -65,14 +65,18 @@ vi.mock('../../../stores/use-challenges-store', () => ({
|
||||
|
||||
vi.mock('@react-spring/web', async () => {
|
||||
const React = await vi.importActual<typeof import('react')>('react');
|
||||
const createSpringValue = (value: number) => ({
|
||||
get: () => value,
|
||||
to: (mapper: (input: number) => unknown) => mapper(value),
|
||||
});
|
||||
return {
|
||||
animated: {
|
||||
div: React.forwardRef(({ children, style, ...props }: any, ref) => createElement('div', { ...props, ref, style: { touchAction: style?.touchAction } }, children)),
|
||||
},
|
||||
useSpring: () => [
|
||||
{
|
||||
x: { get: () => 120 },
|
||||
y: { get: () => 60 },
|
||||
x: createSpringValue(120),
|
||||
y: createSpringValue(60),
|
||||
},
|
||||
{ start: testState.springStartMock },
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user