unit-test: adds missing file
authorMinkyu Kang <mk7.kang@samsung.com>
Fri, 21 Dec 2012 08:07:25 +0000 (17:07 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Fri, 4 Jan 2013 11:19:30 +0000 (20:19 +0900)
This patch adds missing file for gallery widget's unit test.

Change-Id: Id1965b97b9423caa3caece5f815dff14ba69ebe7

tests/unit-tests/gallery/gallery-tests.js [new file with mode: 0644]

diff --git a/tests/unit-tests/gallery/gallery-tests.js b/tests/unit-tests/gallery/gallery-tests.js
new file mode 100644 (file)
index 0000000..531f432
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Unit Test: gallery 
+ *
+ * Minkyu Kang <mk7.kang@samsung.com>
+ */
+
+(function ($) {
+       module("gallery");
+
+       var unit_gallery = function ( widget, count ) {
+               var imagesldier,
+                       refresh = function ( widget ) {
+                               widget.gallery("refresh");
+                               return widget.find(".ui-gallery-bg");
+                       };
+
+               /* Create */
+               widget.gallery();
+
+               gallery = widget.find(".ui-gallery-bg");
+               ok( gallery, "Create" );
+
+               /* Initialize */
+               equal( gallery.length, count, "Initialize" );
+
+               /* API: add */
+               widget.gallery("add", "05.jpg");
+               widget.gallery("add", "06.jpg");
+               gallery = refresh( widget );
+               equal( gallery.length, count + 2, "API: add" );
+
+               /* API: del */
+               widget.gallery("remove");
+               gallery = refresh( widget );
+               equal( gallery.length, count + 1, "API: del" );
+       };
+
+       test( "gallery", function () {
+               unit_gallery( $("#gallery"), 4 );
+       });
+}( jQuery ));