Skip to content

Commit b8f4be6

Browse files
committed
update firefox specs
1 parent 49fcfc0 commit b8f4be6

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

packages/react-image-focal-point/e2e/basic.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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');

packages/react-image-focal-point/e2e/controlled.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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');

packages/react-image-focal-point/e2e/styled.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)