[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/bootstrap/js/tests/unit/ -> bootstrap-tab.js (source)

   1  $(function () {
   2  
   3      module("bootstrap-tabs")
   4  
   5        test("should be defined on jquery object", function () {
   6          ok($(document.body).tab, 'tabs method is defined')
   7        })
   8  
   9        test("should return element", function () {
  10          ok($(document.body).tab()[0] == document.body, 'document.body returned')
  11        })
  12  
  13        test("should activate element by tab id", function () {
  14          var tabsHTML =
  15              '<ul class="tabs">'
  16            + '<li><a href="#home">Home</a></li>'
  17            + '<li><a href="#profile">Profile</a></li>'
  18            + '</ul>'
  19  
  20          $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
  21  
  22          $(tabsHTML).find('li:last a').tab('show')
  23          equals($("#qunit-fixture").find('.active').attr('id'), "profile")
  24  
  25          $(tabsHTML).find('li:first a').tab('show')
  26          equals($("#qunit-fixture").find('.active').attr('id'), "home")
  27        })
  28  
  29        test("should activate element by tab id", function () {
  30          var pillsHTML =
  31              '<ul class="pills">'
  32            + '<li><a href="#home">Home</a></li>'
  33            + '<li><a href="#profile">Profile</a></li>'
  34            + '</ul>'
  35  
  36          $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
  37  
  38          $(pillsHTML).find('li:last a').tab('show')
  39          equals($("#qunit-fixture").find('.active').attr('id'), "profile")
  40  
  41          $(pillsHTML).find('li:first a').tab('show')
  42          equals($("#qunit-fixture").find('.active').attr('id'), "home")
  43        })
  44  
  45  })


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1