File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed
packages/react-image-focal-point/e2e Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ test.describe('basic with scroll', () => {
6565 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grab;' ) ;
6666 } ) ;
6767
68- const REAL_FIREFOX_SCROLL_Y = 686 ; // Weird firefox scroll Y
69-
7068 test ( 'should place the focal point button on X=60% and Y=40% when it moves X=1180px and Y=1120px because page has 1000px of margin' , async ( {
7169 page,
72- browserName,
7370 } ) => {
7471 const focalPointButton = page . getByRole ( 'button' , { name : 'Focal Point' } ) ;
7572 const scrollY = 800 ;
@@ -80,7 +77,7 @@ test.describe('basic with scroll', () => {
8077 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grabbing;' ) ;
8178
8279 const x = 1180 ;
83- const y = 1120 - ( browserName === 'firefox' ? REAL_FIREFOX_SCROLL_Y : scrollY ) ;
80+ const y = 1120 - scrollY ;
8481 await page . mouse . move ( x , y ) ;
8582 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 60%; top: 40%; cursor: grabbing;' ) ;
8683 await focalPointButton . dispatchEvent ( 'mouseup' ) ;
Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ test.describe('controlled with scroll', () => {
6565 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 5%; top: 10%; cursor: grab;' ) ;
6666 } ) ;
6767
68- const REAL_FIREFOX_SCROLL_Y = 686 ; // Weird firefox scroll Y
69-
7068 test ( 'should place the focal point button on X=60% and Y=40% when it moves X=1180px and Y=1120px because page has 1000px of margin' , async ( {
7169 page,
72- browserName,
7370 } ) => {
7471 const focalPointButton = page . getByRole ( 'button' , { name : 'Focal Point' } ) ;
7572 const scrollY = 800 ;
@@ -80,7 +77,7 @@ test.describe('controlled with scroll', () => {
8077 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 5%; top: 10%; cursor: grabbing;' ) ;
8178
8279 const x = 1180 ;
83- const y = 1120 - ( browserName === 'firefox' ? REAL_FIREFOX_SCROLL_Y : scrollY ) ;
80+ const y = 1120 - scrollY ;
8481 await page . mouse . move ( x , y ) ;
8582 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 60%; top: 40%; cursor: grabbing;' ) ;
8683 await focalPointButton . dispatchEvent ( 'mouseup' ) ;
Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ test.describe('styled with scroll', () => {
6565 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grab;' ) ;
6666 } ) ;
6767
68- const REAL_FIREFOX_SCROLL_Y = 686 ; // Weird firefox scroll Y
69-
7068 test ( 'should place the focal point button on X=36% and Y=24% when it moves X=1180px and Y=1120px because page has 1000px of margin' , async ( {
7169 page,
72- browserName,
7370 } ) => {
7471 const focalPointButton = page . getByRole ( 'button' , { name : 'Focal Point' } ) ;
7572 const scrollY = 800 ;
@@ -80,7 +77,7 @@ test.describe('styled with scroll', () => {
8077 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grabbing;' ) ;
8178
8279 const x = 1180 ;
83- const y = 1120 - ( browserName === 'firefox' ? REAL_FIREFOX_SCROLL_Y : scrollY ) ;
80+ const y = 1120 - scrollY ;
8481 await page . mouse . move ( x , y ) ;
8582 await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 36%; top: 24%; cursor: grabbing;' ) ;
8683 await focalPointButton . dispatchEvent ( 'mouseup' ) ;
You can’t perform that action at this time.
0 commit comments