File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " hypernova-vue" ,
3
- "version" : " 3.0.0-alpha.0 " ,
3
+ "version" : " 3.0.2 " ,
4
4
"description" : " Vue bindings for Hypernova" ,
5
5
"main" : " lib/index.js" ,
6
6
"types" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -56,6 +56,23 @@ describe('mountComponent', () => {
56
56
57
57
expect ( node . innerHTML ) . toEqual ( '<h1>Ara Framework</h1>' ) ;
58
58
} ) ;
59
+
60
+ test ( 'should mount component correctly ignoring html comments' , ( ) => {
61
+ document . body . innerHTML = '<div id="app"><!-- Comment --><div>' ;
62
+
63
+ const app = Vue . extend ( {
64
+ props : [ 'title' ] ,
65
+ render ( h ) : VNode {
66
+ return h ( 'h1' , { } , this . title ) ;
67
+ } ,
68
+ } ) ;
69
+
70
+ const node = document . getElementById ( 'app' ) ;
71
+
72
+ mountComponent ( app , node , { title : 'Ara Framework' } ) ;
73
+
74
+ expect ( node . innerHTML ) . toEqual ( '<!-- Comment --><h1>Ara Framework</h1>' ) ;
75
+ } ) ;
59
76
} ) ;
60
77
61
78
describe ( 'renderInPlaceholder' , ( ) => {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const mountComponent = (
26
26
propsData : data ,
27
27
} ) ;
28
28
29
- if ( ! node . firstChild ) {
29
+ if ( ! node . childElementCount ) {
30
30
node . appendChild ( document . createElement ( 'div' ) ) ;
31
31
}
32
32
You can’t perform that action at this time.
0 commit comments