]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Unit tests: Only display fixture on-screen for iOS 15955/head
authorHeinrich Fenkart <hnrch02@gmail.com>
Sun, 1 Mar 2015 08:46:49 +0000 (09:46 +0100)
committerHeinrich Fenkart <hnrch02@gmail.com>
Sun, 1 Mar 2015 08:49:59 +0000 (09:49 +0100)
Since only on iOS tests fail when the fixture is displayed off-screen, see https://travis-ci.org/twbs/bootstrap/jobs/52605742

js/tests/index.html

index cdfe02b2754eca2ae8d8b30e42e1cde7bdaee0bd..6f94e415d6d825e908bd008e613ca26a686d9190 100644 (file)
     <!-- QUnit -->
     <link rel="stylesheet" href="vendor/qunit.css" media="screen">
     <script src="vendor/qunit.js"></script>
-    <style>
-      #qunit-fixture {
-        top: 0;
-        left: 0;
-      }
-    </style>
     <script>
       // See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
       var log = []
         $('#qunit-fixture').empty()
         $('#modal-test, .modal-backdrop').remove()
       })
+
+      // Display fixture on-screen on iOS to avoid false positives
+      if (/iPhone|iPad|iPod/.test(navigator.userAgent)) {
+        QUnit.begin(function() {
+          $('#qunit-fixture').css({ top: 0, left: 0 })
+        })
+
+        QUnit.done(function () {
+          $('#qunit-fixture').css({ top: '', left: '' })
+        })
+      }
     </script>
 
     <!-- Plugin sources -->