File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,4 +29,18 @@ moduleWithDocument('Node', (helper) => {
2929 assert . strictEqual ( body . lastChild , div , 'parents last child is set' ) ;
3030 } ) ;
3131
32+ QUnit . test ( 'nodeValue is mutable' , ( assert ) => {
33+ const doc = helper . document ;
34+ const text = doc . createTextNode ( 'hello world' ) ;
35+ const comment = doc . createComment ( 'goodbye cruel world' ) ;
36+
37+ assert . strictEqual ( text . nodeValue , 'hello world' , 'precond - node value is set' ) ;
38+ assert . strictEqual ( comment . nodeValue , 'goodbye cruel world' , 'precond - node value is set' ) ;
39+
40+ text . nodeValue = text . nodeValue . toUpperCase ( ) ;
41+ comment . nodeValue = comment . nodeValue . toUpperCase ( ) ;
42+
43+ assert . strictEqual ( text . nodeValue , 'HELLO WORLD' ) ;
44+ assert . strictEqual ( comment . nodeValue , 'GOODBYE CRUEL WORLD' , 'precond - node value is set' ) ;
45+ } ) ;
3246} ) ;
Original file line number Diff line number Diff line change @@ -148,12 +148,12 @@ export interface SimpleRawHTMLSection extends SimpleNodeBase {
148148
149149export interface SimpleText extends SimpleNodeBase {
150150 readonly nodeType : NodeType . TEXT_NODE ;
151- readonly nodeValue : string ;
151+ nodeValue : string ;
152152}
153153
154154export interface SimpleComment extends SimpleNodeBase {
155155 readonly nodeType : NodeType . COMMENT_NODE ;
156- readonly nodeValue : string ;
156+ nodeValue : string ;
157157}
158158
159159/**
You can’t perform that action at this time.
0 commit comments