feat(view): adds event binding to view instantiation.

Only native non-bubbling events are supported by the commit.
This commit is contained in:
Rado Kirov
2015-01-12 11:50:54 -08:00
parent bccc863567
commit c5b0baf805
6 changed files with 75 additions and 7 deletions

View File

@ -9,7 +9,7 @@ describe('hello world', function () {
it('should greet', function() {
browser.get(URL);
expect(getShadowText('hello-app')).toBe('hello world!');
expect(getGreetingText('hello-app')).toBe('hello world!');
});
});
@ -19,12 +19,12 @@ describe('hello world', function () {
it('should greet', function() {
browser.get(URL);
expect(getShadowText('hello-app')).toBe('hello world!');
expect(getGreetingText('hello-app')).toBe('hello world!');
});
});
});
function getShadowText(selector) {
return browser.executeScript('return document.querySelector("'+selector+'").shadowRoot.textContent');
}
function getGreetingText(selector) {
return browser.executeScript('return document.querySelector("'+selector+'").shadowRoot.firstChild.textContent');
}