1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-03 16:51:54 +02:00

tests & docs & twipsy too

This commit is contained in:
Rod Vagg
2011-11-06 13:20:09 +11:00
parent 3628eb79ae
commit 4d2e32e809
4 changed files with 70 additions and 10 deletions

View File

@@ -73,4 +73,27 @@ $(function () {
$('#qunit-runoff').empty()
})
})
test("should allow arbitrary template html with title and content selector options", function() {
$.support.transition = false
var expectedTitle = 'Gotta make you understand'
, popover = $('<a href="#">@rvagg</a>')
.attr('title', expectedTitle)
.data('content', '<p><b>Never gonna give you up</b>,</p><p>Never gonna let you down</p>')
.appendTo('#qunit-runoff')
.popover({
html: true
, titleSelector: 'h1'
, contentSelector: '.rick > .roll'
, template: '<div class="rick"><h1></h1><div class="roll"></div></div>'
})
.popover('show')
ok($('.popover > div > h1').length, 'h1 tag was inserted')
ok($('.popover > div > h1').text() === expectedTitle)
ok($('.popover > .rick > .roll > p').length === 2, 'p > b tags were inserted')
popover.popover('hide')
ok(!$('.popover').length, 'popover was removed')
$('#qunit-runoff').empty()
})
})