From 92147fe2693349abbc4e2b0821c7928309c51c60 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Tue, 2 Jun 2015 13:57:13 -0700 Subject: [PATCH] Fixed a test that was actually invalid. --- src/kibana/components/filter_bar/lib/generateMappingChain.js | 2 +- .../unit/specs/components/filter_bar/generateMappingChain.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kibana/components/filter_bar/lib/generateMappingChain.js b/src/kibana/components/filter_bar/lib/generateMappingChain.js index b908ea343635..092a14e21f4f 100644 --- a/src/kibana/components/filter_bar/lib/generateMappingChain.js +++ b/src/kibana/components/filter_bar/lib/generateMappingChain.js @@ -14,7 +14,7 @@ define(function (require) { if (result === filter) { return next(filter); } - throw result; + return Promise.reject(result); }); }; }; diff --git a/test/unit/specs/components/filter_bar/generateMappingChain.js b/test/unit/specs/components/filter_bar/generateMappingChain.js index 283133791389..38277aa82596 100644 --- a/test/unit/specs/components/filter_bar/generateMappingChain.js +++ b/test/unit/specs/components/filter_bar/generateMappingChain.js @@ -15,13 +15,14 @@ define(function (require) { it('should create a chaning function which calls the next function if the promise is rejected', function (done) { + var filter = {}; var mapping = sinon.stub(); - mapping.returns(Promise.reject()); + mapping.returns(Promise.reject(filter)); var mappingChainFn = generateMappingChain(mapping); var next = sinon.stub(); next.returns(Promise.resolve('good')); var chain = mappingChainFn(next); - chain({}).then(function (result) { + chain(filter).then(function (result) { expect(result).to.be('good'); sinon.assert.calledOnce(next); done();