@@ -9,18 +9,20 @@ describe("Pan Touch [Base]", () => {
99 disablePadding : true ,
1010 } ) ;
1111 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
12- touchPan ( { x : 100 , y : 100 } ) ;
12+ touchPan ( { x : - 100 , y : - 100 } ) ;
1313 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
1414 } ) ;
1515 it ( "should return to position with padding enabled" , async ( ) => {
1616 const { content, touchPan } = renderApp ( {
17- alignmentAnimation : {
17+ autoAlignment : {
1818 disabled : false ,
1919 } ,
2020 } ) ;
2121 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
22- touchPan ( { x : 100 , y : 100 } ) ;
23- expect ( content . style . transform ) . toBe ( "translate(100px, 100px) scale(1)" ) ;
22+ touchPan ( { x : - 100 , y : - 100 } ) ;
23+ expect ( content . style . transform ) . toBe (
24+ "translate(-100px, -100px) scale(1)" ,
25+ ) ;
2426 await waitFor ( ( ) => {
2527 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
2628 } ) ;
@@ -30,10 +32,10 @@ describe("Pan Touch [Base]", () => {
3032 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
3133 zoom ( { value : 1.5 } ) ;
3234 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1.5)" ) ;
33- touchPan ( { x : 100 , y : 100 } ) ;
35+ touchPan ( { x : - 100 , y : - 100 } ) ;
3436 await sleep ( 10 ) ;
3537 expect ( content . style . transform ) . toBe (
36- "translate(100px, 100px) scale(1.5)" ,
38+ "translate(- 100px, - 100px) scale(1.5)" ,
3739 ) ;
3840 } ) ;
3941 } ) ;
@@ -45,8 +47,8 @@ describe("Pan Touch [Base]", () => {
4547 } ,
4648 } ) ;
4749 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
48- touchPan ( { x : 100 , y : 100 } ) ;
49- expect ( content . style . transform ) . toBe ( "translate(0px, 100px) scale(1)" ) ;
50+ touchPan ( { x : - 100 , y : - 100 } ) ;
51+ expect ( content . style . transform ) . toBe ( "translate(0px, - 100px) scale(1)" ) ;
5052 } ) ;
5153 it ( "should not change y axis transform" , async ( ) => {
5254 const { content, touchPan } = renderApp ( {
@@ -55,8 +57,8 @@ describe("Pan Touch [Base]", () => {
5557 } ,
5658 } ) ;
5759 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
58- touchPan ( { x : 100 , y : 100 } ) ;
59- expect ( content . style . transform ) . toBe ( "translate(100px, 0px) scale(1)" ) ;
60+ touchPan ( { x : - 100 , y : - 100 } ) ;
61+ expect ( content . style . transform ) . toBe ( "translate(- 100px, 0px) scale(1)" ) ;
6062 } ) ;
6163 } ) ;
6264 describe ( "When disabled" , ( ) => {
@@ -65,7 +67,7 @@ describe("Pan Touch [Base]", () => {
6567 disabled : true ,
6668 } ) ;
6769 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
68- touchPan ( { x : 100 , y : 100 } ) ;
70+ touchPan ( { x : - 100 , y : - 100 } ) ;
6971 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
7072 } ) ;
7173 it ( "should not change transform" , async ( ) => {
@@ -75,7 +77,7 @@ describe("Pan Touch [Base]", () => {
7577 } ,
7678 } ) ;
7779 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
78- touchPan ( { x : 100 , y : 100 } ) ;
80+ touchPan ( { x : - 100 , y : - 100 } ) ;
7981 expect ( content . style . transform ) . toBe ( "translate(0px, 0px) scale(1)" ) ;
8082 } ) ;
8183 } ) ;
0 commit comments