Index: tests/html/table_test.dart |
diff --git a/tests/html/table_test.dart b/tests/html/table_test.dart |
index fda9fcccef14b14195eb34498d9fb73e14b571f7..5c1144f5d2e266cad0d0eb0a4e2e5401cc51dfd3 100644 |
--- a/tests/html/table_test.dart |
+++ b/tests/html/table_test.dart |
@@ -13,31 +13,49 @@ main() { |
test('createTBody', () { |
var table = new TableElement(); |
var head = table.createTHead(); |
- var headerRow = head.insertRow(-1); |
- var headerCell = headerRow.insertCell(-1); |
+ expect(table.tHead, head); |
+ |
+ var headerRow = head.addRow(); |
+ var headerCell = headerRow.addCell(); |
headerCell.text = 'Header Cell'; |
- var body = table.createTBody(); |
- var bodyRow = body.insertRow(-1); |
- var bodyCell = bodyRow.insertCell(-1); |
- bodyCell.text = 'Body Cell'; |
+ var caption = table.createCaption(); |
+ expect(table.caption, caption); |
+ var body = table.createTBody(); |
expect(table.tBodies.length, 1); |
expect(table.tBodies[0], body); |
+ var bodyRow = body.addRow(); |
+ expect(body.rows.length, 1); |
+ expect(body.rows[0], bodyRow); |
+ |
+ var bodyCell = bodyRow.addCell(); |
+ bodyCell.text = 'Body Cell'; |
+ expect(bodyRow.cells.length, 1); |
+ expect(bodyRow.cells[0], bodyCell); |
+ |
var foot = table.createTFoot(); |
- var footerRow = foot.insertRow(-1); |
- var footerCell = footerRow.insertCell(-1); |
+ expect(table.tFoot, foot); |
+ |
+ var footerRow = foot.addRow(); |
+ expect(foot.rows.length, 1); |
+ expect(foot.rows[0], footerRow); |
+ |
+ var footerCell = footerRow.addCell(); |
footerCell.text = 'Footer Cell'; |
+ expect(footerRow.cells.length, 1); |
+ expect(footerRow.cells[0], footerCell); |
var body2 = table.createTBody(); |
- var bodyRow2 = body2.insertRow(-1); |
- var bodyCell2 = bodyRow2.insertCell(-1); |
+ var bodyRow2 = body2.addRow(); |
+ var bodyCell2 = bodyRow2.addCell(); |
bodyCell2.text = 'Body Cell2'; |
+ expect(body2.rows.length, 1); |
+ |
expect(table.tBodies.length, 2); |
expect(table.tBodies[1], body2); |
- |
}); |
} |