File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,21 @@ describe('markdown-toolbar-element', function () {
1111 } )
1212 } )
1313
14+ describe ( 'in shadow DOM' , function ( ) {
15+ it ( 'finds field and inserts markdown' , function ( ) {
16+ const div = document . createElement ( 'div' )
17+ const shadow = div . attachShadow ( { mode : 'open' } )
18+ shadow . innerHTML = `<markdown-toolbar for="id"><md-bold>bold</md-bold></markdown-toolbar><textarea id="id"></textarea>`
19+ document . body . append ( div )
20+
21+ const toolbar = shadow . querySelector ( 'markdown-toolbar' )
22+ assert ( toolbar . field , 'textarea is found' )
23+
24+ toolbar . querySelector ( 'md-bold' ) . click ( )
25+ assert ( toolbar . field . value , '****' )
26+ } )
27+ } )
28+
1429 describe ( 'after tree insertion' , function ( ) {
1530 function focus ( ) {
1631 const textarea = document . querySelector ( 'textarea' )
You can’t perform that action at this time.
0 commit comments