blob: 4b220b94777206e8076037404b675729253bed72 [file] [log] [blame]
<html>
<import src="../resources/chai.sky" />
<import src="../resources/mocha.sky" />
<style media="(max-width: 0px)">
#test { color: rgb(255, 0, 0); }
</style>
<div id="does-not-match">Should not be red.</div>
<style media="(max-width: 10000px)">
#matches { color: rgb(255, 0, 0); }
</style>
<div id="matches">Should be red.</div>
<script>
describe('Media queries', function() {
it('should allow sheets to apply when they match', function() {
var element = document.getElementById('matches');
assert.equal(getComputedStyle(element).color, "rgb(255, 0, 0)");
});
it('should cause sheets to be skipped when they do not match', function() {
var element = document.getElementById('does-not-match');
assert.equal(getComputedStyle(element).color, "rgb(0, 0, 0)");
});
});
</script>
</html>