File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
packages/@ember/-internals/glimmer/tests/integration/modifiers Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,20 @@ moduleFor(
242242
243243 this . assertCounts ( { adds : 1 , removes : 1 } ) ;
244244 }
245+
246+ [ `@test it throws a helpful error when callback is undefined` ] ( assert ) {
247+ let expectedMessage = / Y o u m u s t p a s s a f u n c t i o n a s t h e s e c o n d a r g u m e n t t o t h e ` o n ` m o d i f i e r / ;
248+ assert . throws ( ( ) => {
249+ this . render ( '<button {{on "click" undefined}}>Click Me</button>' ) ;
250+ } , expectedMessage ) ;
251+ }
252+
253+ [ `@test it throws a helpful error when callback is null` ] ( assert ) {
254+ let expectedMessage = / Y o u m u s t p a s s a f u n c t i o n a s t h e s e c o n d a r g u m e n t t o t h e ` o n ` m o d i f i e r / ;
255+ assert . throws ( ( ) => {
256+ this . render ( '<button {{on "click" null}}>Click Me</button>' ) ;
257+ } , expectedMessage ) ;
258+ }
245259 }
246260) ;
247261
@@ -300,18 +314,6 @@ moduleFor(
300314 this . assertCounts ( { adds : 0 , removes : 0 } ) ;
301315 }
302316
303- [ `@test it throws a helpful error when callback is undefined` ] ( assert ) {
304- let expectedMessage = / Y o u m u s t p a s s a f u n c t i o n a s t h e s e c o n d a r g u m e n t t o t h e ` o n ` m o d i f i e r / ;
305- assert . throws ( ( ) => {
306- this . render ( '<button {{on "click" undefined}}>Click Me</button>' ) ;
307- } , expectedMessage ) ;
308- }
309317
310- [ `@test it throws a helpful error when callback is null` ] ( assert ) {
311- let expectedMessage = / Y o u m u s t p a s s a f u n c t i o n a s t h e s e c o n d a r g u m e n t t o t h e ` o n ` m o d i f i e r / ;
312- assert . throws ( ( ) => {
313- this . render ( '<button {{on "click" null}}>Click Me</button>' ) ;
314- } , expectedMessage ) ;
315- }
316318 }
317319) ;
You can’t perform that action at this time.
0 commit comments