Permalink
Browse files

All tests are passing now in IE 6-8. More tests needed!

  • Loading branch information...
1 parent cf94354 commit 831de4906daa189d5757b4cde534cc8728d43d44 scottjehl committed May 24, 2011
Showing with 19 additions and 17 deletions.
  1. +2 −2 test/unit/index.html
  2. +1 −1 test/unit/test.css
  3. +16 −14 test/unit/tests.js
View
4 test/unit/index.html
@@ -5,9 +5,9 @@
<title>Respond.js Test Suite</title>
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" media="screen">
<script src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
- <script src="../../respond.src.js"></script>
<link href="test.css" rel="stylesheet" />
- <link href="test2.css" media="all and (min-width: 1200px)" rel="stylesheet" />
+ <link href="test2.css" media="screen and (min-width: 1200px)" rel="stylesheet" />
+ <script src="../../respond.src.js"></script>
<script src="tests.js"></script>
</head>
View
2 test/unit/test.css
@@ -23,7 +23,7 @@
}/*/mediaquery*/
/*styles for 500px and under*/
-@media screen and (max-width: 480px) {
+@media screen and (max-width: 460px) {
#testelem {
height: 150px;
}
View
30 test/unit/tests.js
@@ -28,31 +28,31 @@ window.onload = function(){
return testElem.offsetHeight === val;
}
-
+ window.moveTo(0,0);
/* TESTS HERE */
asyncTest( 'Styles not nested in media queries apply as expected', function() {
window.resizeTo(200,600);
setTimeout(function(){
ok( widthApplied( 50 ), "testelem is 50px wide when window is 200px wide" );
start();
- }, 50);
+ }, 900);
});
asyncTest( 'styles within min-width media queries apply properly', function() {
window.resizeTo(500,600);
setTimeout(function(){
ok( widthApplied( 150 ), 'testelem is 150px wide when window is 500px wide' );
start();
- }, 50);
+ }, 900);
});
asyncTest( 'styles within max-width media queries apply properly', function() {
window.resizeTo(300,600);
setTimeout(function(){
ok( heightApplied( 150 ), 'testelem is 150px tall when window is under 480px wide' );
start();
- }, 50);
+ }, 900);
});
@@ -62,32 +62,34 @@ window.onload = function(){
setTimeout(function(){
ok( widthApplied( 250 ), "testelem is 250px wide when window is 650px wide" );
start();
- }, 50);
+ }, 900);
});
asyncTest( "styles within a media query with a one true query among other false queries apply properly", function() {
window.resizeTo(800,600);
setTimeout(function(){
ok( widthApplied( 350 ), "testelem is 350px wide when window is 750px wide" );
start();
- }, 50);
+ }, 900);
});
- asyncTest( "stylesheets with a media query in a media attribute apply when they should", function() {
- window.resizeTo(1300,600);
- setTimeout(function(){
- ok( widthApplied( 16 ), "testelem is 16px wide when window is 1300px wide" );
- start();
- }, 50);
- });
+
asyncTest( "Styles within a false media query do not apply", function() {
window.resizeTo(800,600);
setTimeout(function(){
ok( !widthApplied( 500 ), "testelem is not 500px wide when window is 1300px wide" );
start();
- }, 50);
+ }, 900);
+ });
+
+ asyncTest( "stylesheets with a media query in a media attribute apply when they should", function() {
+ window.resizeTo(1300,600);
+ setTimeout(function(){
+ ok( widthApplied( 16 ), "testelem is 16px wide when window is 1300px wide" );
+ start();
+ }, 900);
});
}

0 comments on commit 831de49

Please sign in to comment.