-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into complete-api-doc
- Loading branch information
Showing
245 changed files
with
2,361 additions
and
3,293 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
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
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,32 @@ | ||
var hashTester = require('hsp/utils/hashtester'); | ||
var sample = require('./clickhandler.hsp'); | ||
|
||
describe('"Simple event handler" sample', function () { | ||
|
||
var h; | ||
beforeEach(function () { | ||
h = hashTester.newTestContext(); | ||
sample.template.apply(this, sample.data).render(h.container); | ||
}); | ||
|
||
afterEach(function () { | ||
h.$dispose(); | ||
}); | ||
|
||
it('should render initial state', function () { | ||
expect(h('div').text()).to.equal('Click me to discover hashspace event handlers'); | ||
}); | ||
|
||
it('should cycle through messages on click', function () { | ||
h('div').click(); | ||
expect(h('div > span').text()).to | ||
.equal('Well done - you called the event handler and updated the data model in a row!'); | ||
|
||
h('div').click(); | ||
expect(h('div > span.warning').text()).to.match(/WARNING/); | ||
expect(h('div > span:eq(1)').text()).to.equal('If you click again you will be back to first step!'); | ||
|
||
h('div').click(); | ||
expect(h('div > span').text()).to.equal('Click me to discover hashspace event handlers'); | ||
}); | ||
}); |
Oops, something went wrong.