Permalink
Browse files

merge test split

  • Loading branch information...
2 parents 5322b54 + b4460e1 commit 1ea9a85a4684b467bc286cbd5ce02d9d0b673c7e @johnbender johnbender committed Mar 27, 2013
Showing with 2,132 additions and 723 deletions.
  1. +27 −5 Gruntfile.js
  2. +27 −0 tests/integration/button-markup/buttonMarkup_core.js
  3. +79 −0 tests/integration/button-markup/index.html
  4. +150 −0 tests/integration/checkboxradio/checkboxradio_core.js
  5. +2 −0 tests/integration/checkboxradio/form-result.html
  6. +203 −0 tests/integration/checkboxradio/index.html
  7. 0 tests/{unit → integration}/collapsible/collapsible_core.js
  8. +2 −2 tests/{unit → integration}/collapsible/index.html
  9. 0 tests/{unit → integration}/core/core_scroll.js
  10. +61 −0 tests/integration/core/index.html
  11. +39 −0 tests/integration/degrade-inputs/degradeInputs.js
  12. +18 −32 tests/{unit/dialog/data-attr-init-tests.html → integration/degrade-inputs/index.html}
  13. 0 tests/{unit → integration}/dialog/dialog-no-hash.html
  14. 0 tests/{unit → integration}/dialog/dialog_basic.js
  15. 0 tests/{unit → integration}/dialog/dialog_events.js
  16. 0 tests/{unit → integration}/dialog/dialog_no_hash.js
  17. +122 −0 tests/integration/dialog/index.html
  18. +2 −2 tests/{unit → integration}/dialog/no-hash-tests.html
  19. +295 −0 tests/integration/fixed-toolbar/fixedToolbar.js
  20. +102 −0 tests/integration/fixed-toolbar/index.html
  21. 0 tests/{unit → integration}/listview/cache-tests/cached-nested.html
  22. 0 tests/{unit → integration}/listview/cache-tests/clear.html
  23. 0 tests/{unit → integration}/listview/cache-tests/uncached-nested.html
  24. +2 −2 tests/{unit → integration}/listview/index.html
  25. 0 tests/{unit → integration}/listview/listview_core.js
  26. 0 tests/{unit → integration}/listview/listview_nested.js
  27. +2 −2 tests/{unit → integration}/listview/nested-tests.html
  28. +2 −2 tests/{unit → integration}/listview/push-state-disabled-tests.html
  29. 0 tests/{unit → integration}/navigation/base-change.html
  30. +2 −2 tests/{unit → integration}/navigation/base-tests.html
  31. 0 tests/{unit → integration}/navigation/base-tests/app-base/base-page-1.html
  32. 0 tests/{unit → integration}/navigation/base-tests/app-base/base-page-2.html
  33. 0 tests/{unit → integration}/navigation/base-tests/content/content-page-1.html
  34. 0 tests/{unit → integration}/navigation/base-tests/content/content-page-2.html
  35. 0 tests/{unit → integration}/navigation/blank.html
  36. 0 tests/{unit → integration}/navigation/cached-external.html
  37. 0 tests/{unit → integration}/navigation/data-url-tests/data-url.html
  38. 0 tests/{unit → integration}/navigation/data-url-tests/nested.html
  39. 0 tests/{unit → integration}/navigation/data-url-tests/non-data-url.html
  40. 0 tests/{unit → integration}/navigation/data-url-tests/parentheses.html
  41. 0 tests/{unit → integration}/navigation/data-url-tests/reverse-attr.html
  42. 0 tests/{unit → integration}/navigation/data-url-tests/single-quotes.html
  43. 0 tests/{unit → integration}/navigation/dialog-param-test/dialog-param.html
  44. 0 tests/{unit → integration}/navigation/dialog.html
  45. +1 −1 tests/{unit → integration}/navigation/event/beforenavigate-tests.html
  46. 0 tests/{unit → integration}/navigation/event/event_beforenavigate.js
  47. 0 tests/{unit → integration}/navigation/event/event_core.js
  48. +1 −1 tests/{unit → integration}/navigation/event/index.html
  49. +2 −2 tests/{unit → integration}/navigation/event/push-state-disabled-tests.html
  50. 0 tests/{unit → integration}/navigation/external.html
  51. 0 tests/{unit → integration}/navigation/file.html
  52. 0 tests/{unit → integration}/navigation/form-tests/changepage-data.html
  53. 0 tests/{unit → integration}/navigation/form-tests/form-no-action.html
  54. 0 tests/{unit → integration}/navigation/go-to-dialog.html
  55. +10 −10 tests/{unit → integration}/navigation/index.html
  56. +2 −2 tests/{unit → integration}/navigation/init-query-param-hash-tests.html
  57. 0 tests/{unit → integration}/navigation/init-tests/navigation_query_param_hash.js
  58. +2 −2 tests/{unit → integration}/navigation/init-tests/query-param-hash.html
  59. +1 −1 tests/{unit → integration}/navigation/method/index.html
  60. 0 tests/{unit → integration}/navigation/method/method_core.js
  61. +2 −2 tests/{unit → integration}/navigation/method/push-state-disabled-method-tests.html
  62. +2 −2 tests/{unit → integration}/navigation/multipage/index.html
  63. 0 tests/{unit → integration}/navigation/multipage/multipage_core.js
  64. 0 tests/{unit → integration}/navigation/navigation_base.js
  65. +1 −1 tests/{unit → integration}/navigation/navigation_core.js
  66. 0 tests/{unit → integration}/navigation/navigation_paths.js
  67. 0 tests/{unit → integration}/navigation/navigation_transitions.js
  68. 0 tests/{unit → integration}/navigation/path-tests/file.html
  69. 0 tests/{unit → integration}/navigation/path-tests/parent-ref.html
  70. 0 tests/{unit → integration}/navigation/path-tests/parent/index.html
  71. 0 tests/{unit → integration}/navigation/path-tests/sub-dir/file.html
  72. 0 tests/{unit → integration}/navigation/path-tests/sub-dir/index.html
  73. 0 tests/{unit → integration}/navigation/prefetched-dialog.html
  74. 0 tests/{unit → integration}/navigation/prefetched.html
  75. +2 −2 tests/{unit → integration}/navigation/push-state-disabled-base-tests.html
  76. +2 −2 tests/{unit → integration}/navigation/push-state-disabled-tests.html
  77. 0 tests/{unit → integration}/navigation/sequence/another-page.html
  78. 0 tests/{unit → integration}/navigation/sequence/basic-dialog.html
  79. 0 tests/{unit → integration}/navigation/sequence/basic-dialog1.html
  80. +2 −2 tests/{unit → integration}/navigation/sequence/index.html
  81. 0 tests/{unit → integration}/navigation/sequence/sequence-dialog-hash-key-tests.html
  82. 0 tests/{unit → integration}/navigation/sequence/sequence-path1-path2-dialog-hash-key-tests.html
  83. +2 −2 .../{unit → integration}/navigation/sequence/sequence-push-state-disabled-dialog-hash-key-tests.html
  84. +2 −2 ...egration}/navigation/sequence/sequence-push-state-disabled-path1-path2-dialog-hash-key-tests.html
  85. +2 −2 tests/{unit → integration}/navigation/sequence/sequence-push-state-disabled-tests.html
  86. +2 −2 tests/{unit → integration}/navigation/sequence/sequence-redirect.html
  87. 0 tests/{unit → integration}/navigation/sequence/sequence_core.js
  88. 0 tests/{unit → integration}/navigation/title1.html
  89. 0 tests/{unit → integration}/navigation/title2.html
  90. 0 tests/{unit → integration}/navigation/title3.html
  91. +10 −10 tests/{unit → integration}/navigation/transition-tests.html
  92. +3 −3 tests/{unit/page/page-with-entities-in-title-tests.html → integration/page/index.html}
  93. 0 tests/{unit → integration}/page/page_title_entity.js
  94. 0 tests/{unit → integration}/select/cached-dom-cache-true.html
  95. +3 −3 tests/{unit → integration}/select/cached-tests.html
  96. 0 tests/{unit → integration}/select/cached.html
  97. +4 −0 tests/integration/select/defineKeepNative.js
  98. +160 −1 tests/{unit/select/suite.html → integration/select/index.html}
  99. 0 tests/{unit → integration}/select/select_cached.js
  100. +535 −0 tests/integration/select/select_core.js
  101. +34 −0 tests/integration/select/select_events.js
  102. +124 −0 tests/integration/select/select_native.js
  103. 0 tests/{unit → integration}/select/uncached-dom-cached-false.html
  104. 0 tests/{unit → }/jquery.setNameSpace.js
  105. 0 tests/{unit → }/swarminject.js
  106. +2 −2 tests/unit/button-markup/index.html
  107. +2 −2 tests/unit/button/index.html
  108. +16 −161 tests/unit/checkboxradio/checkboxradio_core.js
  109. +2 −2 tests/unit/checkboxradio/index.html
  110. +2 −2 tests/unit/controlgroup/index.html
  111. +3 −4 tests/unit/core/index.html
  112. +0 −32 tests/unit/degrade-inputs/degradeInputs.js
  113. +2 −2 tests/unit/degrade-inputs/index.html
  114. +5 −63 tests/unit/dialog/index.html
  115. +2 −2 tests/unit/event/index.html
  116. +2 −2 tests/unit/field-contain/index.html
  117. +0 −298 tests/unit/fixed-toolbar/fixedToolbar.js
  118. +2 −2 tests/unit/fixed-toolbar/index.html
  119. +2 −2 tests/unit/init/dialog-load-tests.html
  120. +2 −2 tests/unit/init/index.html
  121. +2 −2 tests/unit/init/nopage.html
  122. +2 −2 tests/unit/kitchensink/index.html
  123. +1 −2 tests/unit/kitchensink/kitchensink_core.js
  124. +2 −2 tests/unit/loader/index.html
  125. +2 −2 tests/unit/media/index.html
  126. +2 −2 tests/unit/navbar/index.html
  127. +2 −2 tests/unit/page-sections/index.html
  128. +2 −2 tests/unit/page/index.html
  129. +2 −2 tests/unit/panel/index.html
  130. +2 −2 tests/unit/path/index.html
  131. +2 −2 tests/unit/popup/index.html
  132. +2 −2 tests/unit/rangeslider/index.html
  133. +2 −2 tests/unit/reset/index.html
  134. +2 −2 tests/unit/select/index.html
  135. +2 −2 tests/unit/slider/index.html
  136. +2 −2 tests/unit/support/index.html
  137. +2 −2 tests/unit/table/index.html
  138. +1 −1 tests/unit/textinput/index.html
  139. +2 −2 tests/unit/widget/index.html
  140. +2 −2 tests/unit/zoom/index.html
  141. +2 −2 tests/unit/zoom/initial-disable.html
View
@@ -359,19 +359,41 @@ module.exports = function( grunt ) {
urls: (function() {
// Find the test files
var suites = grunt.util._.without( ( grunt.option( "suites" ) || "" ).split( "," ), "" ),
- patterns, paths, idx,
+ types = grunt.util._.without( ( grunt.option( "types" ) || "" ).split( "," ), "" ),
+ patterns, paths, idx, prefixes = ["tests/unit/", "tests/integration/"],
onePath = "",
uniquePaths = [],
versionedPaths = [],
jQueries = grunt.util._.without( ( grunt.option( "jqueries" ) || process.env.JQUERIES || "" ).split( "," ), "" );
+ if( types.length ){
+ prefixes = [];
+ types.forEach(function( type ) {
+ prefixes.push( "tests/" + type +"/" );
+ });
+ }
+
+ patterns = [];
+
if ( suites.length ) {
- patterns = [];
- suites.forEach( function( suite ) {
- patterns = patterns.concat( [ "tests/unit/" + suite + "/index.html", "tests/unit/" + suite + "/*/index.html", "tests/unit/" + suite + "/**/*-tests.html" ] );
+ suites.forEach( function( unit ) {
+ prefixes.forEach( function( prefix ) {
+ patterns = patterns.concat([
+ prefix + unit + "/",
+ prefix + unit + "/index.html",
+ prefix + unit + "/*/index.html",
+ prefix + unit + "/**/*-tests.html"
+ ]);
+ });
});
} else {
- patterns = [ "tests/unit/*/index.html", "tests/unit/*/*/index.html", "tests/unit/**/*-tests.html" ];
+ prefixes.forEach( function( prefix ) {
+ patterns = patterns.concat([
+ prefix + "*/index.html",
+ prefix + "*/*/index.html",
+ prefix + "**/*-tests.html"
+ ]);
+ });
}
paths = grunt.file.expand( patterns )
@@ -0,0 +1,27 @@
+/*
+ * mobile buttonMarkup tests
+ */
+(function($){
+ module("jquery.mobile.buttonMarkup.js");
+
+ asyncTest( "ui-btn-* should be applied based on a setting", function() {
+ // force touch support so the timeout is set
+ $.Event.prototype.originalEvent = {
+ type: "touch"
+ };
+
+ var $btn = $( "#hover-delay" );
+
+
+ $btn.trigger( "vmousedown" );
+
+ setTimeout(function() {
+ ok( $btn.attr("class").indexOf( "ui-btn-down" ) == -1, "button doesn't have the down class yet" );
+ }, $.mobile.buttonMarkup.hoverDelay / 2);
+
+ setTimeout(function() {
+ ok( $btn.attr("class").indexOf( "ui-btn-down" ) >= 0, "button has the down class yet" );
+ start();
+ }, $.mobile.buttonMarkup.hoverDelay + 100 );
+ });
+})(jQuery);
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery Mobile Button Markup Test Suite</title>
+ <!-- meta viewport left out on purpose for test append -->
+ <script src="../../../external/requirejs/require.js"></script>
+ <script src="../../../js/requirejs.config.js"></script>
+ <script src="../../../js/jquery.tag.inserter.js"></script>
+ <script src="../../jquery.setNameSpace.js"></script>
+ <script src="../../../external/qunit.js"></script>
+ <script src="../../jquery.testHelper.js"></script>
+ <script>
+ $.testHelper.asyncLoad([
+ [
+ "jquery.mobile.buttonMarkup",
+ "widgets/controlgroup",
+ "widgets/fixedToolbar",
+ "widgets/forms/button",
+ ],
+ [ "jquery.mobile.init" ],
+ [
+ "buttonMarkup_core.js"
+ ]
+ ]);
+ </script>
+
+ <link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css" />
+ <link rel="stylesheet" href="../../../external/qunit.css"/>
+
+ <script src="../../swarminject.js"></script>
+</head>
+<body>
+
+<h1 id="qunit-header">jQuery Mobile Button Markup Test Suite</h1>
+<h2 id="qunit-banner"></h2>
+<h2 id="qunit-userAgent"></h2>
+<ol id="qunit-tests">
+</ol>
+
+<div data-nstest-role="page" id="default">
+ <div data-nstest-role="header" id="page-header">
+ <a id="header-button-1" data-role="button" href="index.html">Header button 1</a>
+ <a id="header-button-2" data-role="button" href="index.html">Header button 2</a>
+ </div>
+ <div data-nstest-role="content" id="control-group-content">
+ <input type="submit" data-nstest-role="button" value="Double Enhanced?" id="double-enhanced" />
+ <a href="index.html" data-nstest-role="button" data-nstest-shadow="false">No shadow</a>
+ <a href="index.html" data-nstest-role="button" data-nstest-corners="false">No corners</a>
+ <a href="index.html" data-nstest-role="button" data-nstest-shadow="false" data-nstest-corners="false">No shadow or corners</a>
+ <a href="index.html" data-nstest-role="button" data-nstest-icon="delete" data-nstest-iconshadow="false">No iconshadow</a>
+ <button data-nstest-shadow="false" data-nstest-corners="false" data-nstest-icon="delete" data-nstest-iconshadow="false">None of the above</button>
+ <svg id="embedded-svg" width="120" height="120" viewPort="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="10" y="10" width="100" height="100"/>
+ </svg>
+
+ <a href="docs-bars.html" data-nstest-role="button" id="full">Fullsize</a>
+ <a href="docs-bars.html" data-nstest-role="button" data-nstest-mini="true" id="mini">Mini</a>
+
+ <div data-nstest-role="controlgroup" data-nstest-mini="true" id="mini-control">
+ <a href="index.html" data-nstest-role="button">Yes</a>
+ </div>
+
+ <a id="iconpos1" data-nstest-role="button" href="index.html" data-nstest-icon="check">Default iconpos</a>
+ <a id="iconpos2" data-nstest-role="button" href="index.html" data-nstest-icon="check" data-nstest-iconpos="left">Left iconpos</a>
+ <a id="iconpos3" data-nstest-role="button" href="index.html" data-nstest-icon="check" data-nstest-iconpos="right">Right iconpos</a>
+ <a id="hover-delay" data-nstest-role="button" href="index.html"></a>
+ </div>
+ <div data-nstest-role="footer" id="control-group-footer" class="ui-bar" data-nstest-position="inline">
+ <div data-nstest-role="controlgroup" data-nstest-type="horizontal">
+ <a href="index.html" data-nstest-icon="delete">Remove</a>
+ <a href="index.html" data-nstest-icon="plus">Add</a>
+ <a href="index.html" data-nstest-icon="arrow-u">Up</a>
+ <a href="index.html" data-nstest-icon="arrow-d">Down</a>
+ </div>
+ </div>
+</div>
+</body>
+</html>
@@ -0,0 +1,150 @@
+/*
+ * mobile checkboxradio unit tests
+ */
+(function($){
+ module( 'jquery.mobile.forms.checkboxradio.js' );
+
+ asyncTest( "radio button labels should update the active button class to last clicked and clear checked", function(){
+ var $radioBtns = $( '#radio-active-btn-test input' ),
+ singleActiveAndChecked = function(){
+ deepEqual( $( "#radio-active-btn-test .ui-radio-on" ).length, 1, "there should be only one active button" );
+ // Use the .checked property, not the checked attribute which is not dynamic
+ var numChecked = 0;
+ $( "#radio-active-btn-test input" ).each(function(i, e) {
+ if( e.checked ) {
+ numChecked++;
+ }
+ });
+ deepEqual( numChecked, 1, "there should be only one checked" );
+ };
+
+ $.testHelper.sequence([
+ function(){
+ $radioBtns.last().siblings( 'label' ).click();
+ },
+
+ function(){
+ ok( $radioBtns.last().prop( 'checked' ), "last input is checked" );
+ ok( $radioBtns.last().siblings( 'label' ).hasClass( 'ui-radio-on' ),
+ "last input label is an active button" );
+
+ ok( !$radioBtns.first().prop( 'checked' ), "first input label is not active" );
+ ok( !$radioBtns.first().siblings( 'label' ).hasClass( 'ui-radio-on' ),
+ "first input label is not active" );
+
+ singleActiveAndChecked();
+
+ $radioBtns.first().siblings( 'label' ).click();
+ },
+
+ function(){
+ ok( $radioBtns.first().prop( 'checked' ));
+ ok( $radioBtns.first().siblings( 'label' ).hasClass( 'ui-radio-on' ),
+ "first input label is an active button" );
+
+ ok( !$radioBtns.last().prop( 'checked' ));
+ ok( !$radioBtns.last().siblings( 'label' ).hasClass( 'ui-radio-on' ),
+ "last input label is not active" );
+
+ singleActiveAndChecked();
+
+ start();
+ }
+ ], 500);
+
+ });
+
+ asyncTest( "clicking the label triggers a click on the element", function() {
+ var clicked = false;
+
+ expect( 1 );
+
+ $( "#checkbox-click-triggered" ).one('click', function() {
+ clicked = true;
+ });
+
+ $.testHelper.sequence([
+ function() {
+ $( "[for='checkbox-click-triggered']" ).click();
+ },
+
+ function() {
+ ok(clicked, "click was fired on input");
+ start();
+ }
+ ], 2000);
+ });
+
+ asyncTest( "clicking the label triggers a change on the element", function() {
+ var changed = false;
+
+ expect( 1 );
+
+ $( "#checkbox-change-triggered" ).one('change', function() {
+ changed = true;
+ });
+
+ $.testHelper.sequence([
+ function() {
+ $( "[for='checkbox-change-triggered']" ).click();
+ },
+
+ function() {
+ ok(changed, "change was fired on input");
+ start();
+ }
+ ], 2000);
+ });
+
+ asyncTest( "form submission should include radio button values", function() {
+ var $form = $( "#radio-form" ), $input = $form.find("input").first();
+
+ $.testHelper.pageSequence([
+ function() {
+ $input.click();
+ $form.submit();
+ },
+
+ function( timeout ){
+ var check = location.hash || location.search;
+
+ ok( check.indexOf("radio1=1") >= 0, "the radio was checked" );
+
+ // if the changepage in the previous function failed don't go back
+ if( !timeout ){
+ window.history.back();
+ }
+ },
+
+ function(){
+ start();
+ }
+ ]);
+ });
+
+ asyncTest( "form submission should include checkbox button values", function() {
+ var $form = $( "#check-form" ), $inputs = $form.find("input");
+
+ $.testHelper.pageSequence([
+ function() {
+ $inputs.click();
+ $form.submit();
+ },
+
+ function( timeout ){
+ var check = location.hash || location.search;
+
+ ok( check.indexOf("checkbox-form=on") >= 0, "the first checkbox was checked" );
+ ok( check.indexOf("checkbox-form-2=on") >= 0, "the second checkbox was checked" );
+ // if the changepage in the previous function failed don't go back
+ if( !timeout ){
+ window.history.back();
+ }
+ },
+
+ function(){
+ start();
+ }
+ ]);
+ });
+})(jQuery);
@@ -0,0 +1,2 @@
+<div id="form-result" data-role="page">
+</div>
Oops, something went wrong.

0 comments on commit 1ea9a85

Please sign in to comment.