4 * Hyunjung Kim <hjnim.kim@samsung.com>
12 var unit_swipe = function( swipelist, type ) {
17 slideLeftDone = function () {
18 ok(true, "Animation Complete - sliding left");
19 cover.unbind("animationComplete");
20 equal(cover.position().left, coverStart, "Position - Cover");
23 slideRightDone = function () {
24 ok(true, "Animation Complete - sliding right");
25 setTimeout(function () {
26 cover.unbind("animationComplete");
27 cover.bind("animationComplete", slideLeftDone);
28 item.trigger("swipeleft");
32 $("#swipelistpage").page();
33 swipelist.swipelist();
35 ok(swipelist.hasClass("ui-swipelist"),"Create - Swipelist");
36 covers = swipelist.find("li *.ui-swipelist-item-cover");
37 cover = covers.first();
38 coverStart = cover.position().left;
39 item = swipelist.find("li").first();
41 cover.bind("animationComplete", slideRightDone);
42 cover.trigger("swiperight");
45 equal( swipelist.find("li.ui-swipelist-item").length , 2, "Count - Swipeable li");
46 equal( covers.length , 2, "Count - cover");
48 equal(covers.find("span.ui-swipelist-item-cover-inner:contains('1line-leftsub1')").length,
50 "Check - Cover string value");
53 var unit_swipe_destroy = function(swipelist, type) {
55 new_page = $("#swipedestorypage");
58 swipelist.swipelist();
59 ok(swipelist.hasClass("ui-swipelist"),"Create - Swipelist");
60 covers = swipelist.find("li *.ui-swipelist-item-cover");
62 equal( swipelist.find("li.ui-swipelist-item").length , 2, "Count - Swipeable li");
63 equal( covers.length , 2, "Count - cover");
65 swipelist.swipelist("destroy");
67 equal(new_page.has('.ui-swipelist').length, 0, "Destroy - list");
68 equal(new_page.has('.ui-swipelist-item').length, 0 , "Destroy - item" );
69 equal(new_page.has('.ui-swipelist-item-cover').length, 0, "Destroy - cover");
73 asyncTest( " swipelist ", function() {
75 unit_swipe( $("#swipewidget"), "swipelist" );
79 asyncTest( " swipelist - destory", function() {
81 unit_swipe_destroy( $("#swipedestroy"), "swipelistdestroy"),