@@ -150,7 +150,7 @@ describe("Images addon", function () {
150150 } ) ;
151151
152152 it ( 'triggers input event on showImage' , function ( done ) {
153- this . $el . one ( 'input ', function ( ) {
153+ this . editor . subscribe ( 'editableInput ', function ( ) {
154154 expect ( true ) . toBe ( true ) ;
155155 done ( ) ;
156156 } ) ;
@@ -169,15 +169,14 @@ describe("Images addon", function () {
169169
170170 spyOn ( this . addon , 'getDOMImage' ) . and . returnValue ( stubbedImage ) ;
171171
172- this . $el . on ( 'input ', function ( ) {
172+ this . editor . subscribe ( 'editableInput ', function ( ) {
173173 inputTriggerCount ++ ;
174174
175175 if ( inputTriggerCount === 2 ) {
176- this . $el . off ( 'input' ) ;
177176 expect ( true ) . toBe ( true ) ;
178177 done ( ) ;
179178 }
180- } . bind ( this ) ) ;
179+ } ) ;
181180
182181 this . addon . showImage ( 'http://image.co' , {
183182 context : context
@@ -272,7 +271,7 @@ describe("Images addon", function () {
272271 it ( 'triggers input event after removing image' , function ( done ) {
273272 var $event = $ . Event ( 'keydown' ) ;
274273
275- this . $el . one ( 'input ', function ( ) {
274+ this . editor . subscribe ( 'editableInput ', function ( ) {
276275 expect ( true ) . toBe ( true ) ;
277276 done ( ) ;
278277 } ) ;
@@ -322,7 +321,7 @@ describe("Images addon", function () {
322321 . attr ( 'class' , 'medium-insert-images medium-insert-active medium-insert-images-left' )
323322 . append ( '<figure><img src="image1.jpg" alt=""></figure>' ) ;
324323
325- this . $el . one ( 'input ', function ( ) {
324+ this . editor . subscribe ( 'editableInput ', function ( ) {
326325 expect ( true ) . toBe ( true ) ;
327326 done ( ) ;
328327 } ) ;
0 commit comments