Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi committed Jun 7, 2023
1 parent 4e99147 commit d827b17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ const Preview: React.FC<PreviewProps> = props => {
};

const onFlipX = () => {
updateTransform({ flipX: !transform.flipX }, 'flipY');
updateTransform({ flipX: !transform.flipX }, 'flipX');
};

const onFlipY = () => {
updateTransform({ flipY: !transform.flipY }, 'flipX');
updateTransform({ flipY: !transform.flipY }, 'flipY');
};

const onSwitchLeft: React.MouseEventHandler<HTMLDivElement> = event => {
Expand Down
19 changes: 11 additions & 8 deletions tests/preview.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -832,13 +832,16 @@ describe('Preview', () => {
});

expect(onTransform).toBeCalledTimes(1);
expect(onTransform).toBeCalledWith({
flipX: false,
flipY: true,
rotate: 0,
scale: 1,
x: 0,
y: 0,
});
expect(onTransform).toBeCalledWith(
{
flipY: true,
flipX: false,
rotate: 0,
scale: 1,
x: 0,
y: 0,
},
'flipY',
);
});
});

0 comments on commit d827b17

Please sign in to comment.