added regression test for #214
This commit is contained in:
parent
6f6ea4ce0d
commit
0bc94a73cd
3 changed files with 2886 additions and 0 deletions
2858
tests/e2e/libs/syn.js
Normal file
2858
tests/e2e/libs/syn.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -7,6 +7,7 @@
|
||||||
<link rel="stylesheet" href="libs/qunit.css" media="screen">
|
<link rel="stylesheet" href="libs/qunit.css" media="screen">
|
||||||
<script src="libs/qunit.js"></script>
|
<script src="libs/qunit.js"></script>
|
||||||
<!-- Load local lib and tests. -->
|
<!-- Load local lib and tests. -->
|
||||||
|
<script src="libs/syn.js"></script>
|
||||||
<script src="../../mithril.js"></script>
|
<script src="../../mithril.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -235,3 +235,30 @@ test('node identity shuffle and remove', function() {
|
||||||
equal(dummyEl.firstChild.firstChild.nextSibling.nextSibling, e1, 'e1 is third element')
|
equal(dummyEl.firstChild.firstChild.nextSibling.nextSibling, e1, 'e1 is third element')
|
||||||
equal(dummyEl.firstChild.firstChild.nextSibling.nextSibling.nextSibling, e2, 'e2 is fourth element')
|
equal(dummyEl.firstChild.firstChild.nextSibling.nextSibling.nextSibling, e2, 'e2 is fourth element')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
asyncTest('issue214 regression', function() {
|
||||||
|
// see https://github.com/lhorie/mithril.js/issues/214
|
||||||
|
// this test will pass using phantomjs, because phantomjs
|
||||||
|
// doesn't provide window.requestAnimationFrame
|
||||||
|
expect(2)
|
||||||
|
|
||||||
|
function controller() {
|
||||||
|
this.inputValue = m.prop('')
|
||||||
|
}
|
||||||
|
|
||||||
|
function view(ctrl) {
|
||||||
|
return m('input#testinput', {
|
||||||
|
value: ctrl.inputValue(),
|
||||||
|
onkeyup: m.withAttr('value', ctrl.inputValue)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var ctrl = m.module(dummyEl, { controller: controller, view: view })
|
||||||
|
|
||||||
|
Syn.click({}, 'testinput')
|
||||||
|
.type('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', function() {
|
||||||
|
equal(ctrl.inputValue(), 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee')
|
||||||
|
equal(document.getElementById('testinput').value, 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee')
|
||||||
|
start()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue