vue2/test/functional/specs/extend.js

27 lines
1021 B
JavaScript
Raw Normal View History

2013-12-24 08:48:14 +08:00
casper.test.begin('Encapsulation & Inheritance', 8, function (test) {
casper
2013-12-25 05:55:29 +08:00
.start('./fixtures/extend.html')
.then(function () {
test.assertSelectorHasText('.dir', 'directive works')
test.assertSelectorHasText('.filter', 'filter works')
test.assertSelectorHasText('.partial', 'partial works')
test.assertSelectorHasText('.vm', 'component works')
2014-03-13 05:02:21 +08:00
test.assertSelectorHasText('.vm-w-model', 'component + with works')
2013-12-19 13:20:00 +08:00
test.assertSelectorHasText('#log', 'T created T ready T created C created T ready C ready', 'hook inheritance works')
test.assertSelectorHasText('.cvm', 'component works', 'Child should have access to Parent options')
2013-12-25 05:55:29 +08:00
})
.thenEvaluate(function () {
test.vmData = {
selfMsg: 'replacing $data ',
msg: 'also works'
}
})
.then(function () {
2013-12-24 08:48:14 +08:00
test.assertSelectorHasText('.vm-w-model', 'replacing $data also works')
})
.run(function () {
test.done()
})
})