4 * Hyunjung Kim <hjnim.kim@samsung.com>
12 var unit_swipe = function( swipe, type ) {
17 slideLeftDone = function () {
18 ok(true, "Animation end - sliding left");
19 cover.unbind("animationend");
20 equal(cover.position().left, coverStart, "Position - Cover");
23 slideRightDone = function () {
24 ok(true, "Animation end - sliding right");
25 setTimeout(function () {
26 cover.unbind("animationend");
27 cover.bind("animationend", slideLeftDone);
28 item.trigger("swipeleft");
32 $("#swipepage").page();
34 ok(swipe.hasClass("ui-swipe"), "Create - Swipe");
36 covers = swipe.find("div.ui-swipe-item-cover");
37 cover = covers.first();
39 coverStart = cover.position().left;
40 item = swipe.find("div.ui-swipe-item").first();
42 cover.bind("animationend", slideRightDone);
43 cover.trigger("swiperight");
46 equal( swipe.find("div.ui-swipe-item").length , 1, "Count - Swipeable li");
47 equal( covers.length , 1, "Count - cover");
49 equal( covers.get(0).innerText,
51 "Check - Cover string value");
54 var unit_swipe_destroy = function(swipe, type) {
56 new_page = $("#swipedestorypage");
60 ok(swipe.hasClass("ui-swipe"),"Create - Swipe");
61 covers = swipe.find("div.ui-swipe-item-cover");
62 equal( swipe.find("div.ui-swipe-item").length , 1, "Count - Swipeable ui-swipe-item");
64 equal( covers.length , 1, "Count - cover");
66 swipe.swipe("destroy");
68 equal(swipe.has('.ui-swipe').length, 0, "Destroy - swipe");
69 equal(swipe.has('.ui-swipe-item').length, 0 , "Destroy - item" );
70 equal(swipe.has('.ui-swipe-item-cover').length, 0, "Destroy - cover");
74 asyncTest( " swipe ", function() {
76 unit_swipe( $("#swipewidget"), "swipe" );
80 asyncTest( " swipe - destory", function() {
82 unit_swipe_destroy( $("#swipedestroy"), "swipedestroy"),