UnitTC: Additional unit testcases have been added
[platform/framework/web/web-ui-fw.git] / tests / additional-unit-tests / headerfooter / headerfooter-tests.js
1 /*
2  * Unit Test: Header Footer
3  *
4  *
5  */
6 /*jslint browser: true*/
7 /*global $, jQuery, test, equal, ok*/
8 $( document ).ready( function ( ) {
9
10         module("Header Footer");
11
12         var unit_headerfooter_test = function ( widget, type ) {
13                 var html ;
14
15                 /*Markuo check*/
16                 equal( widget.hasClass('ui-' + type ), true, "Markup check") ;
17
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") ;
21
22                 /*hide show API*/
23                 widget.hide( );
24                 equal( widget.css('display'), 'none', "API hide") ;
25                 widget.show( );
26                 equal( widget.css('display'), 'block', "API show") ;
27
28                 /*add text */
29                 html = "<h1>Sample text</h1>";
30                 widget.html( html );
31                 $('.ui.page-active').page('refresh') ;
32                 equal( widget.html( ) , html, "Markup check after adding text") ;
33         } ;
34
35         test("Header", function ( ) {
36                 // trigger pagecreate
37                 $("#headerfooter-unit-test").page( );
38                 unit_headerfooter_test( $("#headerfooter-unit-test").find(':jqmData(role=header)') , 'header') ;
39
40         } );
41
42         test("footer", function ( ) {
43                 // trigger pagecreate
44                 $("#headerfooter-unit-test-footer").page( );
45                 unit_headerfooter_test( $("#headerfooter-unit-test-footer").find(':jqmData(role=footer)'), 'footer') ;
46
47         } );
48
49 } );