Skip to content

Commit

Permalink
adding test for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
eavichay committed May 9, 2017
1 parent 01eed39 commit 26ae440
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/binding.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Slim.tag('test-binding',
`
<h1 click="changeName" bind>Hello, [[myName]]</h1>
<h2 bind>[[rev(myName)]]</h2>
<div id="check-prop" attr="[[myName]]">Test Div</div>
<div id="check-method" attr="[[rev(myName)]]">Test Div</div>
`,
Expand Down
4 changes: 4 additions & 0 deletions tests/binding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ module.exports = {
browser.waitForElementPresent('body');
browser.waitForElementPresent('test-binding');
browser.waitForElementPresent('h1');
browser.waitForElementPresent('h2');
browser.assert.containsText('h1', 'Hello, eavichay');
browser.assert.containsText('h2', 'yahcivae');
browser.assert.attributeEquals('#check-prop', 'attr', 'eavichay');
browser.assert.attributeEquals('#check-method', 'attr', 'yahcivae');
browser.click('h1');
browser.assert.containsText('h1', 'Hello, slim.js');
browser.assert.containsText('h2', 'sj.mils');
browser.assert.attributeEquals('#check-prop', 'attr', 'slim.js');
browser.assert.attributeEquals('#check-method', 'attr', 'sj.mils');
browser.execute(`
document.querySelector('test-binding').myName = 'test';
`);
browser.assert.containsText('h1', 'Hello, test');
browser.assert.containsText('h2', 'tset');
browser.assert.attributeEquals('#check-prop', 'attr', 'test');
browser.assert.attributeEquals('#check-method', 'attr', 'tset');
}
Expand Down

0 comments on commit 26ae440

Please sign in to comment.