bootstrap-collapse.js 843 B

12345678910111213141516171819202122232425
  1. $(function () {
  2. module("bootstrap-collapse")
  3. test("should be defined on jquery object", function () {
  4. ok($(document.body).collapse, 'collapse method is defined')
  5. })
  6. test("should return element", function () {
  7. ok($(document.body).collapse()[0] == document.body, 'document.body returned')
  8. })
  9. test("should show a collapsed element", function () {
  10. var el = $('<div class="collapse"></div>').collapse('show')
  11. ok(el.hasClass('in'), 'has class in')
  12. ok(/height/.test(el.attr('style')), 'has height set')
  13. })
  14. test("should hide a collapsed element", function () {
  15. var el = $('<div class="collapse"></div>').collapse('hide')
  16. ok(!el.hasClass('in'), 'does not have class in')
  17. ok(/height/.test(el.attr('style')), 'has height set')
  18. })
  19. })