@@ -93,6 +93,22 @@ suite('dom', () => {
9393 assert ( ! div . firstChild ) ;
9494 } ) ;
9595
96+ test ( 'should buld nodes with id' , ( ) => {
97+ const div = $ ( 'div#foo' ) ;
98+ assert ( div ) ;
99+ assert ( div instanceof HTMLElement ) ;
100+ assert . equal ( div . tagName , 'DIV' ) ;
101+ assert . equal ( div . id , 'foo' ) ;
102+ } ) ;
103+
104+ test ( 'should buld nodes with class-name' , ( ) => {
105+ const div = $ ( 'div.foo' ) ;
106+ assert ( div ) ;
107+ assert ( div instanceof HTMLElement ) ;
108+ assert . equal ( div . tagName , 'DIV' ) ;
109+ assert . equal ( div . className , 'foo' ) ;
110+ } ) ;
111+
96112 test ( 'should build nodes with attributes' , ( ) => {
97113 let div = $ ( 'div' , { class : 'test' } ) ;
98114 assert . equal ( div . className , 'test' ) ;
@@ -111,5 +127,12 @@ suite('dom', () => {
111127
112128 assert . equal ( div . firstChild && div . firstChild . textContent , 'hello' ) ;
113129 } ) ;
130+
131+ test ( 'should build nodes with text children' , ( ) => {
132+ let div = $ ( 'div' , undefined , 'foobar' ) ;
133+ let firstChild = div . firstChild as HTMLElement ;
134+ assert . equal ( firstChild . tagName , undefined ) ;
135+ assert . equal ( firstChild . textContent , 'foobar' ) ;
136+ } ) ;
114137 } ) ;
115138} ) ;
0 commit comments