@@ -101,6 +101,22 @@ define(function (require, exports, module) {
101
101
expect ( Object . keys ( json ) . length ) . toBeGreaterThan ( 0 ) ;
102
102
} ) ;
103
103
} ) ;
104
+
105
+ it ( "should retrieve the HTML docs database" , function ( ) {
106
+ var json ;
107
+
108
+ runs ( function ( ) {
109
+ main . _getDocs ( "html.json" ) . done ( function ( result ) {
110
+ json = result ;
111
+ } ) ;
112
+ } ) ;
113
+
114
+ waitsFor ( function ( ) { return json !== undefined ; } , "read html.json database" , 5000 ) ;
115
+
116
+ runs ( function ( ) {
117
+ expect ( Object . keys ( json ) . length ) . toBeGreaterThan ( 0 ) ;
118
+ } ) ;
119
+ } ) ;
104
120
105
121
} ) ;
106
122
@@ -165,9 +181,37 @@ define(function (require, exports, module) {
165
181
queryInlineAtPos ( testHTMLInfo , 0 , true , "border" ) ;
166
182
} ) ;
167
183
168
- it ( "should open docs for HTML" , function ( ) {
184
+ it ( "should open docs when the selection is on an HTML tag " , function ( ) {
169
185
queryInlineAtPos ( testHTMLInfo , 1 , true , "<body>" ) ;
170
186
} ) ;
187
+
188
+ it ( "should not open docs when the selection is on an invalid HTML tag" , function ( ) {
189
+ queryInlineAtPos ( testHTMLInfo , 2 , false ) ;
190
+ } ) ;
191
+
192
+ it ( "should not open docs when the selection is not an HTML tag" , function ( ) {
193
+ /* Text */
194
+ queryInlineAtPos ( testHTMLInfo , 3 , false ) ;
195
+
196
+ /* Commented tag */
197
+ queryInlineAtPos ( testHTMLInfo , 4 , false ) ;
198
+ } ) ;
199
+
200
+ it ( "should open docs when the selection is on an HTML attribute" , function ( ) {
201
+ queryInlineAtPos ( testHTMLInfo , 5 , true , "<div>" ) ;
202
+ } ) ;
203
+
204
+ it ( "should open docs for tag (fallback) when the selection is on an HTML attribute's value" , function ( ) {
205
+ queryInlineAtPos ( testHTMLInfo , 6 , true , "<div>" ) ;
206
+ } ) ;
207
+
208
+ it ( "should open docs for tag (fallback) when the selection is on an invalid HTML attribute" , function ( ) {
209
+ queryInlineAtPos ( testHTMLInfo , 7 , true , "<div>" ) ;
210
+ } ) ;
211
+
212
+ it ( "should not open docs when the selection is on an invalid HTML attribute on an invalid HTML tag" , function ( ) {
213
+ queryInlineAtPos ( testHTMLInfo , 8 , false ) ;
214
+ } ) ;
171
215
172
216
} ) ;
173
217
0 commit comments