Fix id/class collection from stylesheets

BUG=438036
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/785313002
This commit is contained in:
Rafael Weinstein 2014-12-09 15:05:42 -08:00
parent b33ce1e3a0
commit 08b367be54
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,6 @@
Running 2 tests
ok 1 Div width should grow width to 200px
ok 2 Div width should grow height to 200px
2 tests
2 pass
0 fail

View File

@ -0,0 +1,29 @@
<sky>
<import src="../resources/mocha.sky" />
<import src="../resources/chai.sky" />
<style>
div { width: 100px; height: 100px; background-color: red; }
div.wide { width: 200px; }
div#high { height: 200px; }
</style>
<div></div>
<div></div>
<script>
describe("Div width", function() {
it("should grow width to 200px", function() {
var target = document.querySelector('div');
target.classList.add("wide");
assert.equal(getComputedStyle(target).width, "200px");
});
it("should grow height to 200px", function() {
var target = document.querySelectorAll('div')[1];
target.id = 'high';
assert.equal(getComputedStyle(target).height, "200px");
});
});
</script>
</sky>