template.js 778 B

12345678910111213141516171819
  1. casper.test.begin('Templates and Partials', 6, function (test) {
  2. casper
  3. .start('./fixtures/template.html')
  4. .then(function () {
  5. test.assertSelectorHasText('#usa', 'Hi dude', 'global partial')
  6. test.assertSelectorHasText('#japan', 'こんにちは', 'local partial')
  7. test.assertSelectorHasText('#china', '你好', 'direct option')
  8. test.assertSelectorHasText('#hawaii', 'Aloha', 'extend option')
  9. test.assertSelectorHasText('#repeat', 'Repeat', 'inline partial with repeat')
  10. test.assertEvalEquals(function () {
  11. return document.querySelector('#yielder').innerHTML
  12. }, '<x-yielder><h1>before</h1><p>A</p><p>B</p><h2>after</h2></x-yielder>')
  13. })
  14. .run(function () {
  15. test.done()
  16. })
  17. })