UnitTC: Additional unit testcases have been added
[platform/framework/web/web-ui-fw.git] / tests / additional-unit-tests / fastscroll / fastscroll-tests.js
1 /*
2  * Unit Test: FastScroll
3  *
4  * Minkyu Kang <mk7.kang@samsung.com>
5  */
6 /*jslint browser: true*/
7 /*global $, jQuery, test, equal, ok*/
8 ( function ( $ ) {
9         module("FastScroll");
10
11         var unit_fastscroll = function ( list ) {
12                 var widget,
13                         shortcut,
14                         divider,
15                         fastpopup,
16                         i;
17
18                 widget = list.parentsUntil(".ui-content").parent( ).find(".ui-fastscroll");
19                 ok( widget , "Markup check: fast scroll");
20                 fastpopup = list.parentsUntil(".ui-content").parent( ).find(".ui-fastscroll-popup");
21                 ok( fastpopup , "Markup check: fastscroll popup");
22
23                 /* Create */
24                 ok( widget.hasClass("ui-fastscroll"), "Create");
25                 shortcut = widget.find("li");
26                 divider = list.find(".ui-li-divider");
27
28                 /* Shortcuts */
29                 for ( i = 0; i < divider.length; i++ ) {
30                         equal( $( divider[i] ).text( ), $( shortcut[i] ).text( ), "Shortcut");
31                 }
32         };
33
34         test("shortcut", function ( ) {
35                 unit_fastscroll( $("#shortcut") );
36         } );
37
38 }( jQuery ) );