vendredi 29 janvier 2016

testing angular google Maps searchBox

I am tesing with Jasmine an angular app which relies on google Maps API, especially on the searchBox component

When the user selects an address listed in the searchBox, google js raises the 'place_changed' event, which I capture in my controller.

myapp.directive('googlemap', ["uiGmapGoogleMapApi"
    (uiGmapGoogleMapApi) ->

        restrict: 'EA'
        replace: true
        templateUrl: 'angular_templates/google_map.html'
        scope: {}

        controller: ($scope, $element) ->    
            events = place_changed: (searchBox) ->
                place = searchBox.getPlace()

Question: How can I test with Jasmine that the controller listens to place_changed ?

Aucun commentaire:

Enregistrer un commentaire