File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
test/unit/specs/mount/Wrapper Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ export default class Wrapper implements BaseWrapper {
248248 * Checks if node is empty
249249 */
250250 isEmpty ( ) : boolean {
251- return this . vnode . children === undefined
251+ return this . vnode . children === undefined || this . vnode . children . length === 0
252252 }
253253
254254 /**
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ describe('isEmpty', () => {
99 expect ( wrapper . isEmpty ( ) ) . to . equal ( true )
1010 } )
1111
12+ it ( 'returns true contains empty slot' , ( ) => {
13+ const compiled = compileToFunctions ( '<div><slot></slot></div>' )
14+ const wrapper = mount ( compiled )
15+
16+ expect ( wrapper . isEmpty ( ) ) . to . equal ( true )
17+ } )
18+
1219 it ( 'returns false if node contains other nodes' , ( ) => {
1320 const compiled = compileToFunctions ( '<div><p /></div>' )
1421 const wrapper = mount ( compiled )
You can’t perform that action at this time.
0 commit comments