21
21
* Unit testing of DOM manipulation
22
22
*/
23
23
describe ( "DOM manipulation" , function ( ) {
24
- it ( "Parsing a DOM from a string" , function ( ) {
24
+ it ( "Parses a DOM from a string" , function ( ) {
25
25
var s = "<HTML><BODY><H1>Some title</H1><P>Hello</P></BODY></HTML>" ;
26
26
var dd = DomNode . parseFromString ( s ) ;
27
27
expect ( dd ) . toBeDefined ( ) ;
@@ -33,13 +33,13 @@ describe("DOM manipulation", function() {
33
33
expect ( dd . m_children [ 0 ] . m_children [ 1 ] . getName ( ) ) . toEqual ( "P" ) ;
34
34
} ) ;
35
35
36
- it ( "Parsing a DOM from a document" , function ( ) {
36
+ it ( "Parses a DOM from a document" , function ( ) {
37
37
var dd = DomNode . parseFromDom ( document ) ;
38
38
// Not much we can test without knowing what is in document
39
39
expect ( dd ) . toBeDefined ( ) ;
40
40
} ) ;
41
41
42
- it ( "Parsing a PathExpression from a string" , function ( ) {
42
+ it ( "Parses a PathExpression from a string" , function ( ) {
43
43
var pe = new PathExpression ( ) ;
44
44
pe . parseFromString ( "#document/HTML/BODY/P[1]" ) ;
45
45
expect ( pe . getLength ( ) ) . toEqual ( 4 ) ;
@@ -57,11 +57,11 @@ describe("DOM manipulation", function() {
57
57
expect ( segment . getPosition ( ) ) . toEqual ( 1 ) ;
58
58
} ) ;
59
59
60
- it ( "Getting document element from PathExpression" , function ( ) {
60
+ it ( "Gets document element from PathExpression" , function ( ) {
61
61
// Hard to test, we need a page to do that
62
62
} ) ;
63
63
64
- it ( "Getting DOM element from PathExpression" , function ( ) {
64
+ it ( "Gets DOM element from PathExpression" , function ( ) {
65
65
var s = "<#document><a><b><c>1</c><c>2</c></b><d>3</d><b><c>4</c></b></a></#document>" ;
66
66
var dd = DomNode . parseFromString ( s ) ;
67
67
var path_s = "#document/a/b[1]/c[0]" ;
@@ -72,7 +72,7 @@ describe("DOM manipulation", function() {
72
72
expect ( el . m_children [ 0 ] . getName ( ) ) . toEqual ( "4" ) ;
73
73
} ) ;
74
74
75
- it ( "Getting root DOM element from PathExpression" , function ( ) {
75
+ it ( "Gets root DOM element from PathExpression" , function ( ) {
76
76
var s = "<#document><a><b><c>1</c><c>2</c></b><d>3</d><b><c>4</c></b></a></#document>" ;
77
77
var dd = DomNode . parseFromString ( s ) ;
78
78
var path_s = "#document" ;
@@ -83,7 +83,7 @@ describe("DOM manipulation", function() {
83
83
} ) ;
84
84
85
85
describe ( "Element marking and finding" , function ( ) {
86
- it ( "Finding a marked element" , function ( ) {
86
+ it ( "Finds a marked element" , function ( ) {
87
87
var s = "<#document><a><b><c>1</c><c>2</c></b><d>3</d><b><c>4</c></b></a></#document>" ;
88
88
var dd = DomNode . parseFromString ( s ) ;
89
89
var el = null ;
@@ -100,7 +100,7 @@ describe("DOM manipulation", function() {
100
100
expect ( path_to ) . toEqual ( "#document/a[0]/b[1]" ) ;
101
101
} ) ;
102
102
103
- it ( "Finding a marked element (when only one exists)" , function ( ) {
103
+ it ( "Finds a marked element (when only one exists)" , function ( ) {
104
104
var new_page = DomNode . parseFromString ( "<#document><html><h1>Page 1</h1><p><a>To page 2</a><a>To page 3</a></p></html></#document>" ) ;
105
105
new_page . setAllMarks ( 1 ) ;
106
106
var el = new_page . getElementFromPathString ( "#document/html/p/a[1]" ) ;
@@ -110,13 +110,13 @@ describe("DOM manipulation", function() {
110
110
} ) ;
111
111
} ) ;
112
112
113
- it ( "Comparing identical DOMs" , function ( ) {
113
+ it ( "Compares identical DOMs" , function ( ) {
114
114
var s = "<#document><a><b><c>1</c><c>2</c></b><d>3</d><b><c>4</c></b></a></#document>" ;
115
115
var dd = DomNode . parseFromString ( s ) ;
116
116
expect ( dd . equals ( dd ) ) . toEqual ( true ) ;
117
117
} ) ;
118
118
119
- it ( "Comparing different DOMs" , function ( ) {
119
+ it ( "Compares different DOMs" , function ( ) {
120
120
var dd1 = null ;
121
121
var dd2 = null ;
122
122
var s1 = "<#document><a><b><c>1</c><c>2</c></b><d>3</d><b><c>4</c></b></a></#document>" ;
@@ -126,7 +126,7 @@ describe("DOM manipulation", function() {
126
126
expect ( dd1 . equals ( dd2 ) ) . toEqual ( false ) ;
127
127
} ) ;
128
128
129
- it ( "Comparing a DOM to null" , function ( ) {
129
+ it ( "Compares a DOM to null" , function ( ) {
130
130
var dd1 = null ;
131
131
var s1 = "<#document><a><b><c>1</c><c>2</c></b><d>3</d><b><c>4</c></b></a></#document>" ;
132
132
dd1 = DomNode . parseFromString ( s1 ) ;
0 commit comments