2 * Unit Test: Header Footer
6 /*jslint browser: true*/
7 /*global $, jQuery, test, equal, ok*/
8 $( document ).ready( function ( ) {
10 module("Header Footer");
12 var unit_headerfooter_test = function ( widget, type ) {
16 equal( widget.hasClass('ui-' + type ), true, "Markup check") ;
18 equal( widget.jqmData('position'), 'fixed', "jqmData - position") ;
19 equal( $('.ui.page-active').find('.ui-footer a.ui-btn-back').length, 0, "markup check back button present") ;
20 equal( widget.css('display'), 'block', "CSS check for display") ;
24 equal( widget.css('display'), 'none', "API hide") ;
26 equal( widget.css('display'), 'block', "API show") ;
29 html = "<h1>Sample text</h1>";
31 $('.ui.page-active').page('refresh') ;
32 equal( widget.html( ) , html, "Markup check after adding text") ;
35 test("Header", function ( ) {
37 $("#headerfooter-unit-test").page( );
38 unit_headerfooter_test( $("#headerfooter-unit-test").find(':jqmData(role=header)') , 'header') ;
42 test("footer", function ( ) {
44 $("#headerfooter-unit-test-footer").page( );
45 unit_headerfooter_test( $("#headerfooter-unit-test-footer").find(':jqmData(role=footer)'), 'footer') ;