File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,4 +206,24 @@ describe('bind', () => {
206206 expect ( instance . foo ) . to . have . been . called . exactly ( 0 )
207207 } )
208208 } )
209+
210+ it ( 're-binds actions deeply in the HTML' , async function ( ) {
211+ const instance = document . createElement ( 'bind-test-element' )
212+ chai . spy . on ( instance , 'foo' )
213+ root . appendChild ( instance )
214+ listenForBind ( root )
215+ instance . innerHTML = `
216+ <div>
217+ <div>
218+ <button data-action="click:bind-test-element#foo">
219+ </div>
220+ </div>
221+ `
222+ // We need to wait for a couple of frames after injecting the HTML into to
223+ // controller so that the actions have been bound to the controller.
224+ await waitForNextAnimationFrame ( )
225+ await waitForNextAnimationFrame ( )
226+ instance . querySelector ( 'button' ) . click ( )
227+ expect ( instance . foo ) . to . have . been . called . exactly ( 1 )
228+ } )
209229} )
You can’t perform that action at this time.
0 commit comments