-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: flush to make textContent work with ShadyDOM (#138)
- Loading branch information
1 parent
a992292
commit 9b0c1ac
Showing
3 changed files
with
43 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
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,38 @@ | ||
<!doctype html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>vaadin-button tests</title> | ||
<script src="../../web-component-tester/browser.js"></script> | ||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../test-fixture/test-fixture.html"> | ||
<link rel="import" href="../vaadin-button.html"> | ||
</head> | ||
<body> | ||
<test-fixture id="wrapped-button"> | ||
<template> | ||
<button-test></button-test> | ||
</template> | ||
</test-fixture> | ||
<script> | ||
customElements.whenDefined('vaadin-button').then(() => { | ||
class ButtonTest extends Polymer.Element { | ||
static get template() { | ||
return Polymer.html` | ||
<vaadin-button id="button">Old text</vaadin-button> | ||
`; | ||
} | ||
ready() { | ||
super.ready(); | ||
this.$.button.textContent = 'New text'; | ||
} | ||
} | ||
customElements.define('button-test', ButtonTest); | ||
}); | ||
describe('vaadin-button in template', () => { | ||
it('should flush in ready callback and update inner text', () => { | ||
const wrapper = fixture('wrapped-button'); | ||
expect(wrapper.$.button.innerText.trim()).to.equal('New text'); | ||
}); | ||
}); | ||
</script> | ||
</body> |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
window.VaadinButtonSuites = [ | ||
'vaadin-button_test.html' | ||
'vaadin-button_test.html', | ||
'button-in-template.html' | ||
]; |