File tree Expand file tree Collapse file tree
packages/vue-components/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import closeable from '../directives/Closeable' ;
2+
3+ describe ( 'Closeable directive' , ( ) => {
4+ test ( 'preserves plain text content' , ( ) => {
5+ const element = document . createElement ( 'div' ) ;
6+ element . textContent = 'Plain text' ;
7+
8+ closeable . mounted ( element ) ;
9+
10+ expect ( element . querySelector ( '.content' ) . textContent ) . toBe ( 'Plain text' ) ;
11+ } ) ;
12+ } ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ module.exports = {
5151
5252 const content = document . createElement ( 'div' ) ;
5353 content . classList . add ( 'content' ) ;
54- Array . from ( el . children ) . forEach ( child => content . append ( child ) ) ;
54+ Array . from ( el . childNodes ) . forEach ( child => content . append ( child ) ) ;
5555 el . replaceChildren ( ) ;
5656 el . append ( content ) ;
5757 el . classList . add ( 'closeable-wrapper' ) ;
You can’t perform that action at this time.
0 commit comments