| OLD | NEW |
| 1 <sky> | 1 <sky> |
| 2 <import src="../resources/mocha.sky" /> | |
| 3 <import src="../resources/chai.sky" /> | |
| 4 <style> | 2 <style> |
| 5 div { width: 100px; height: 100px; background-color: red; } | 3 div { width: 100px; height: 100px; background-color: red; } |
| 6 div.wide { width: 200px; } | 4 div.wide { width: 200px; } |
| 7 div#high { height: 200px; } | 5 div#high { height: 200px; } |
| 8 </style> | 6 </style> |
| 9 <div></div> | 7 <div></div> |
| 10 <div></div> | 8 <div></div> |
| 11 <script> | 9 <script> |
| 10 import "../resources/third_party/unittest/unittest.dart"; |
| 11 import "../resources/unit.dart"; |
| 12 | 12 |
| 13 describe("Div width", function() { | 13 import "dart:sky"; |
| 14 it("should grow width to 200px", function() { | 14 |
| 15 void main() { |
| 16 initUnit(); |
| 17 |
| 18 test("should grow width to 200px", () { |
| 15 var target = document.querySelector('div'); | 19 var target = document.querySelector('div'); |
| 16 | 20 |
| 17 target.classList.add("wide"); | 21 target.classList.add("wide"); |
| 18 assert.equal(getComputedStyle(target).width, "200px"); | 22 expect(window.getComputedStyle(target).getPropertyValue("width"), |
| 23 equals("200px")); |
| 19 }); | 24 }); |
| 20 | 25 |
| 21 it("should grow height to 200px", function() { | 26 test("should grow height to 200px", () { |
| 22 var target = document.querySelectorAll('div')[1]; | 27 var target = document.querySelectorAll('div').item(1); |
| 23 | 28 |
| 24 target.id = 'high'; | 29 target.id = 'high'; |
| 25 assert.equal(getComputedStyle(target).height, "200px"); | 30 expect(window.getComputedStyle(target).getPropertyValue("height"), |
| 31 equals("200px")); |
| 26 }); | 32 }); |
| 27 }); | 33 } |
| 28 </script> | 34 </script> |
| 29 </sky> | 35 </sky> |
| OLD | NEW |