Skip to content

Commit 76dbdc7

Browse files
committedFeb 27, 2015
update markdown example & e2e tests for debounce
1 parent fdc0151 commit 76dbdc7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
 

‎examples/markdown/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<body>
1111

1212
<div id="editor">
13-
<textarea v-model="input"></textarea>
13+
<textarea v-model="input" debounce="300"></textarea>
1414
<div v-html="input | marked"></div>
1515
</div>
1616

‎test/e2e/markdown.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
casper.test.begin('markdown', 4, function (test) {
1+
casper.test.begin('markdown', 5, function (test) {
22

33
casper
44
.start('../../examples/markdown/index.html')
@@ -20,6 +20,15 @@ casper.test.begin('markdown', 4, function (test) {
2020
)
2121
// keyUp(13)
2222
})
23+
.then(function () {
24+
// assert the output is not updarted yet because of
25+
// debounce
26+
test.assertEval(function () {
27+
return document.querySelector('#editor div')
28+
.innerHTML === '<h1 id="hello">hello</h1>\n'
29+
})
30+
})
31+
.wait(300) // wait for debounce
2332
.then(function () {
2433
test.assertEval(function () {
2534
return document.querySelector('textarea').value

0 commit comments

Comments
 (0)
Please sign in to comment.