Skip to content

Commit

Permalink
added a unit test for EM unit support in link element media attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjehl committed Jan 16, 2012
1 parent a2ab14b commit cb9569b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/unit/index.html
Expand Up @@ -7,6 +7,7 @@
<script src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<link href="test.css" rel="stylesheet" />
<link href="test2.css" media="screen and (min-width: 1200px)" rel="stylesheet" />
<link href="test3.css" media="screen and (min-width: 87.5em)" rel="stylesheet" />
<script src="../../respond.src.js"></script>
<script src="tests.js"></script>

Expand Down
5 changes: 5 additions & 0 deletions test/unit/test3.css
@@ -0,0 +1,5 @@
/* this stylesheet was referenced via a link that had a media attr defined
it should only apply on screen > 87.5em (1400px) */
#testelem {
width: 25px;
}
7 changes: 7 additions & 0 deletions test/unit/tests.js
Expand Up @@ -131,6 +131,13 @@ window.onload = function(){
}, 900);
});

asyncTest( "stylesheets with an EM-based media query in a media attribute apply when they should", function() {
window.resizeTo(1500,600);
setTimeout(function(){
ok( widthApplied( 25 ), "testelem is 25px wide when window is > 1400px wide" );
start();
}, 900);
});

}

Expand Down

0 comments on commit cb9569b

Please sign in to comment.