Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Fixed a test that was actually invalid. #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define(function (require) {
if (result === filter) {
return next(filter);
}
throw result;
return Promise.reject(result);
});
};
};
Expand Down
5 changes: 3 additions & 2 deletions test/unit/specs/components/filter_bar/generateMappingChain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down