diff --git a/test/unit/directivesSpec.js b/test/unit/directivesSpec.js index 183598f120..f1ca01e918 100644 --- a/test/unit/directivesSpec.js +++ b/test/unit/directivesSpec.js @@ -127,11 +127,12 @@ describe('directives', function () { describe('column', function () { describe('cell editing', function () { - var elm, element, $scope, $compile; + var elm, element, $scope, $compile, $sniffer - beforeEach(inject(function ($rootScope, _$compile_) { + beforeEach(inject(function ($rootScope, _$compile_, _$sniffer_) { $compile = _$compile_; $scope = $rootScope; + $sniffer = _$sniffer_; elm = angular.element( '
' ); @@ -233,10 +234,7 @@ describe('directives', function () { var testName = 'Test Name'; input.val(testName); - expect(function(){ - // Trigger the input handler - input.triggerHandler('keyup'); - }).not.toThrow(); + browserTrigger(input, $sniffer.hasEvent('input') ? 'input' : 'change'); // The value of the input should stay 'Test' expect(input.val()).toEqual(testName);