extend.js 1021 B

123456789101112131415161718192021222324252627
  1. casper.test.begin('Encapsulation & Inheritance', 8, function (test) {
  2. casper
  3. .start('./fixtures/extend.html')
  4. .then(function () {
  5. test.assertSelectorHasText('.dir', 'directive works')
  6. test.assertSelectorHasText('.filter', 'filter works')
  7. test.assertSelectorHasText('.partial', 'partial works')
  8. test.assertSelectorHasText('.vm', 'component works')
  9. test.assertSelectorHasText('.vm-w-model', 'component + with works')
  10. test.assertSelectorHasText('#log', 'T created T ready T created C created T ready C ready', 'hook inheritance works')
  11. test.assertSelectorHasText('.cvm', 'component works', 'Child should have access to Parent options')
  12. })
  13. .thenEvaluate(function () {
  14. test.vmData = {
  15. selfMsg: 'replacing $data ',
  16. msg: 'also works'
  17. }
  18. })
  19. .then(function () {
  20. test.assertSelectorHasText('.vm-w-model', 'replacing $data also works')
  21. })
  22. .run(function () {
  23. test.done()
  24. })
  25. })