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', () => {
65
65
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grab;' ) ;
66
66
} ) ;
67
67
68
- const REAL_FIREFOX_SCROLL_Y = 686 ; // Weird firefox scroll Y
69
-
70
68
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 ( {
71
69
page,
72
- browserName,
73
70
} ) => {
74
71
const focalPointButton = page . getByRole ( 'button' , { name : 'Focal Point' } ) ;
75
72
const scrollY = 800 ;
@@ -80,7 +77,7 @@ test.describe('basic with scroll', () => {
80
77
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grabbing;' ) ;
81
78
82
79
const x = 1180 ;
83
- const y = 1120 - ( browserName === 'firefox' ? REAL_FIREFOX_SCROLL_Y : scrollY ) ;
80
+ const y = 1120 - scrollY ;
84
81
await page . mouse . move ( x , y ) ;
85
82
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 60%; top: 40%; cursor: grabbing;' ) ;
86
83
await focalPointButton . dispatchEvent ( 'mouseup' ) ;
Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ test.describe('controlled with scroll', () => {
65
65
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 5%; top: 10%; cursor: grab;' ) ;
66
66
} ) ;
67
67
68
- const REAL_FIREFOX_SCROLL_Y = 686 ; // Weird firefox scroll Y
69
-
70
68
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 ( {
71
69
page,
72
- browserName,
73
70
} ) => {
74
71
const focalPointButton = page . getByRole ( 'button' , { name : 'Focal Point' } ) ;
75
72
const scrollY = 800 ;
@@ -80,7 +77,7 @@ test.describe('controlled with scroll', () => {
80
77
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 5%; top: 10%; cursor: grabbing;' ) ;
81
78
82
79
const x = 1180 ;
83
- const y = 1120 - ( browserName === 'firefox' ? REAL_FIREFOX_SCROLL_Y : scrollY ) ;
80
+ const y = 1120 - scrollY ;
84
81
await page . mouse . move ( x , y ) ;
85
82
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 60%; top: 40%; cursor: grabbing;' ) ;
86
83
await focalPointButton . dispatchEvent ( 'mouseup' ) ;
Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ test.describe('styled with scroll', () => {
65
65
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grab;' ) ;
66
66
} ) ;
67
67
68
- const REAL_FIREFOX_SCROLL_Y = 686 ; // Weird firefox scroll Y
69
-
70
68
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 ( {
71
69
page,
72
- browserName,
73
70
} ) => {
74
71
const focalPointButton = page . getByRole ( 'button' , { name : 'Focal Point' } ) ;
75
72
const scrollY = 800 ;
@@ -80,7 +77,7 @@ test.describe('styled with scroll', () => {
80
77
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 50%; top: 50%; cursor: grabbing;' ) ;
81
78
82
79
const x = 1180 ;
83
- const y = 1120 - ( browserName === 'firefox' ? REAL_FIREFOX_SCROLL_Y : scrollY ) ;
80
+ const y = 1120 - scrollY ;
84
81
await page . mouse . move ( x , y ) ;
85
82
await expect ( focalPointButton ) . toHaveAttribute ( 'style' , 'left: 36%; top: 24%; cursor: grabbing;' ) ;
86
83
await focalPointButton . dispatchEvent ( 'mouseup' ) ;
You can’t perform that action at this time.
0 commit comments