summaryrefslogtreecommitdiff
path: root/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit-tests/segmentcontrol/segmentcontrol-tests.js')
-rwxr-xr-xtests/unit-tests/segmentcontrol/segmentcontrol-tests.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js b/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js
new file mode 100755
index 00000000..dfc70ee3
--- /dev/null
+++ b/tests/unit-tests/segmentcontrol/segmentcontrol-tests.js
@@ -0,0 +1,33 @@
+/*
+ * controlbar unit tests
+ */
+
+(function ($) {
+ module( "SegmentControl" );
+
+ var unit_segmentcontrol = function ( widget, inputCount ) {
+ var segmentGroup = widget;
+
+ /* Create */
+ ok( segmentGroup, "Create" );
+
+ equal( "fieldcontain", segmentGroup.jqmData("role"), "segment control generate" );
+
+ equal( segmentGroup.find( "input" ).length, inputCount, "segment control listitem count test" );
+
+ equal( segmentGroup.find( "input" ).is( ":jqmData(icon='segment-titlestyle-segonly')" ), true, "segment control style test" );
+ };
+
+ test( "segmentcontrol 2btn test", function () {
+ unit_segmentcontrol( $("#segmentcontrol-2btn"), 2 );
+ });
+
+ test( "segmentcontrol 3btn test", function () {
+ unit_segmentcontrol( $("#segmentcontrol-3btn"), 3 );
+ });
+
+ test( "segmentcontrol 4btn test", function () {
+ unit_segmentcontrol( $("#segmentcontrol-4btn"), 4 );
+ });
+
+})(jQuery);