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 {
248
248
* Checks if node is empty
249
249
*/
250
250
isEmpty ( ) : boolean {
251
- return this . vnode . children === undefined
251
+ return this . vnode . children === undefined || this . vnode . children . length === 0
252
252
}
253
253
254
254
/**
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ describe('isEmpty', () => {
9
9
expect ( wrapper . isEmpty ( ) ) . to . equal ( true )
10
10
} )
11
11
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
+
12
19
it ( 'returns false if node contains other nodes' , ( ) => {
13
20
const compiled = compileToFunctions ( '<div><p /></div>' )
14
21
const wrapper = mount ( compiled )
You can’t perform that action at this time.
0 commit comments