@@ -245,6 +245,18 @@ export function test_parse_ShouldFindEventHandlersInExports() {
245245 TKUnit . assert ( loaded , "Parse should find event handlers in exports." ) ;
246246} ;
247247
248+ export function test_parse_ShouldFindEventHandlersWithOnInExports ( ) {
249+ var loaded ;
250+ var page = builder . parse ( "<Page onloaded='myLoaded'></Page>" , {
251+ myLoaded : args => {
252+ loaded = true ;
253+ }
254+ } ) ;
255+ page . _emit ( "loaded" ) ;
256+
257+ TKUnit . assert ( loaded , "Parse should find event handlers in exports." ) ;
258+ } ;
259+
248260export function test_parse_ShouldSetGridAttachedProperties ( ) {
249261 var p = < Page > builder . parse ( "<Page><GridLayout><Label row='1' col='2' rowSpan='3' colSpan='4' /></GridLayout></Page>" ) ;
250262 var grid = < gridLayoutModule . GridLayout > p . content ;
@@ -368,6 +380,18 @@ export function test_parse_ShouldParseBindingsToEvents() {
368380 TKUnit . assert ( btn . hasListeners ( "tap" ) , "Expected result: true." ) ;
369381} ;
370382
383+ export function test_parse_ShouldParseBindingsToEventsWithOn ( ) {
384+ var p = < Page > builder . parse ( "<Page><Button ontap='{{ myTap }}' /></Page>" ) ;
385+ p . bindingContext = {
386+ myTap : function ( args ) {
387+ //
388+ }
389+ } ;
390+ var btn = < buttonModule . Button > p . content ;
391+
392+ TKUnit . assert ( btn . hasListeners ( "tap" ) , "Expected result: true." ) ;
393+ } ;
394+
371395export function test_parse_ShouldParseBindingsToGestures ( ) {
372396 var p = < Page > builder . parse ( "<Page><Label tap='{{ myTap }}' /></Page>" ) ;
373397 var context = {
@@ -385,6 +409,23 @@ export function test_parse_ShouldParseBindingsToGestures() {
385409 TKUnit . assert ( observer . context === context , "Context should be equal to binding context. Actual result: " + observer . context ) ;
386410} ;
387411
412+ export function test_parse_ShouldParseBindingsToGesturesWithOn ( ) {
413+ var p = < Page > builder . parse ( "<Page><Label ontap='{{ myTap }}' /></Page>" ) ;
414+ var context = {
415+ myTap : function ( args ) {
416+ //
417+ }
418+ } ;
419+
420+ p . bindingContext = context ;
421+ var lbl = < Label > p . content ;
422+
423+ var observer = ( < view . View > lbl ) . getGestureObservers ( gesturesModule . GestureTypes . tap ) [ 0 ] ;
424+
425+ TKUnit . assert ( observer !== undefined , "Expected result: true." ) ;
426+ TKUnit . assert ( observer . context === context , "Context should be equal to binding context. Actual result: " + observer . context ) ;
427+ } ;
428+
388429export function test_parse_ShouldParseSubProperties ( ) {
389430 var p = < Page > builder . parse ( "<Page><Switch style.visibility='collapsed' checked='{{ myProp }}' /></Page>" ) ;
390431 var obj = new observable . Observable ( ) ;
0 commit comments