Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6c447db
commit 7a97fe0
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
test/functional/fixtures/regression/gh-2601/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title></title> | ||
<style> | ||
html, body { | ||
height: 100%; | ||
} | ||
body { | ||
overflow-x: hidden; | ||
} | ||
div { | ||
margin-top: -200px; | ||
} | ||
button { | ||
margin-top: 2000px; | ||
background-color: red; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<button>click me</button> | ||
</div> | ||
<script> | ||
var button = document.querySelector('button'); | ||
|
||
button.addEventListener('click', function () { | ||
window.clicked = true; | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('[Regression](GH-2601) - Scroll to element when page has elements with negative margin', function () { | ||
it('Scroll to element when page has elements with negative margin', function () { | ||
return runTests('testcafe-fixtures/index.js'); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
test/functional/fixtures/regression/gh-2601/testcafe-fixtures/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ClientFunction } from 'testcafe'; | ||
|
||
const getClicked = ClientFunction(() => { | ||
return window.clicked; | ||
}); | ||
|
||
fixture `GH-2601 - Scroll to element when page has elements with negative margin` | ||
.page `http://localhost:3000/fixtures/regression/gh-2601/pages/index.html`; | ||
|
||
test('Scroll to element when page has elements with negative margin', async (t) => { | ||
await t.click('button'); | ||
|
||
const isClicked = await getClicked(); | ||
|
||
await t.expect(isClicked).eql(true); | ||
|
||
}); |