Pārlūkot izejas kodu

Merge pull request #11 from hhzl/master

Added insertTable test
Herbert Vojčík 10 gadi atpakaļ
vecāks
revīzija
6a308c0178
1 mainītis faili ar 23 papildinājumiem un 0 dzēšanām
  1. 23 0
      src/DOMite-Tests.st

+ 23 - 0
src/DOMite-Tests.st

@@ -117,6 +117,29 @@ testInsertStringInFragment
 	self assert: (document body innerHTML endsWith: '>sentinela foo in a bar</div>')
 !
 
+testInsertTable
+	| d tbl tr |
+	d := Domite at: 'html body div#fixture'.
+	tbl := Domite newElement: 'table'.
+	
+	tr := Domite newElement: 'tr'.
+	tr << ((Domite newElement: 'td') << 'A').
+	tr << ((Domite newElement: 'td') << 'B').
+	tr << ((Domite newElement: 'td') << 'C').
+	
+	tbl << tr.
+	
+	tr := Domite newElement: 'tr'.
+	tr << ((Domite newElement: 'td') << 'D').
+	tr << ((Domite newElement: 'td') << 'E').
+	tr << ((Domite newElement: 'td') << 'F').
+	
+	tbl << tr.
+	d << tbl.
+	 
+	self assert: (document body innerHTML endsWith: 'table><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>D</td><td>E</td><td>F</td></tr></table></div>')
+!
+
 testMultipleInserts
 	| d p s |
 	d := Domite fromElement: fixtureDiv.