-
Notifications
You must be signed in to change notification settings - Fork 675
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
8c7f6f9
commit dc4c7f2
Showing
7 changed files
with
94 additions
and
4 deletions.
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
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
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
53 changes: 53 additions & 0 deletions
53
test/functional/fixtures/regression/gh-4222/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,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>gh-4222</title> | ||
<style> | ||
.scroll-content-div { | ||
background-image: linear-gradient(red, yellow); | ||
} | ||
|
||
button { | ||
margin-top: 2000px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<script> | ||
customElements.define('scrollable-area', | ||
class extends HTMLElement { | ||
constructor () { | ||
super(); | ||
|
||
let template = document.getElementById('scrollable-area-template'); | ||
let templateContent = template.content; | ||
|
||
const shadowRoot = this.attachShadow({ mode: 'open' }).appendChild(templateContent.cloneNode(true)); | ||
} | ||
}); | ||
</script> | ||
|
||
<template id="scrollable-area-template"> | ||
<style> | ||
.scrollable-area-div { | ||
height: 500px; | ||
width: 100px; | ||
overflow-y: auto; | ||
} | ||
</style> | ||
|
||
<div class="scrollable-area-div"> | ||
<slot name="scroll-content"></slot> | ||
</div> | ||
</template> | ||
|
||
<scrollable-area> | ||
<div class="scroll-content-div" slot="scroll-content"> | ||
<button onclick="window.clicked = true;">click me</button> | ||
</div> | ||
</scrollable-area> | ||
|
||
</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,7 @@ | ||
describe('[Regression](GH-4222) - Should scroll to element that is inside a template/slot', function () { | ||
it('Should scroll to element that is inside a template/slot', function () { | ||
return runTests('testcafe-fixtures/index.js', null, { skip: 'ie' }); | ||
}); | ||
}); | ||
|
||
|
13 changes: 13 additions & 0 deletions
13
test/functional/fixtures/regression/gh-4222/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,13 @@ | ||
import { ClientFunction } from 'testcafe'; | ||
|
||
fixture `Template/Slots/Scrolling` | ||
.page `http://localhost:3000/fixtures/regression/gh-4222/pages/index.html`; | ||
|
||
const isClicked = ClientFunction(() => window.clicked); | ||
|
||
test('Template/Slots/Scrolling', async t => { | ||
await t.click('button'); | ||
|
||
await t.expect(isClicked()).eql(true); | ||
|
||
}); |
Binary file not shown.