From 5c82f9b27052e2d20913f4498535a92de9c4b21b Mon Sep 17 00:00:00 2001 From: Brian Hann Date: Tue, 28 May 2013 13:19:36 -0500 Subject: [PATCH] Fixed the test scenario for editable cells. I had to inject $sniffer and conditionally use the 'input' event in browserTrigger() rather than 'change'. Not sure why yet, but it works! --- test/unit/directivesSpec.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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);