Skip to content

Commit

Permalink
Merge pull request #3 from rwjblue/ensure-return-value
Browse files Browse the repository at this point in the history
Ensure setModifierManager returns properly.
  • Loading branch information
rwjblue authored Jan 28, 2019
2 parents f693b28 + cef7929 commit bab5df6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/integration/components/modifier-manager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ module('Integration | Component | modifier-manager', function(hooks) {
};
});

module('setModifierManager', function() {
test('it returns the provided object', function(assert) {
let expected = Object.freeze({});
let actual = Ember._setModifierManager(() => {}, expected);

assert.strictEqual(actual, expected, 'the passed in object was returned');
});
});

module('installModifier', function(hooks) {
hooks.beforeEach(function() {
class DidInsertModifier {}
Expand Down
1 change: 1 addition & 0 deletions vendor/ember-modifier-manager-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { lte, gte } from 'ember-compatibility-helpers';
let MODIFIER_MANAGERS = new WeakMap();
Ember._setModifierManager = function Polyfilled_setModifierManager(managerFactory, modifier) {
MODIFIER_MANAGERS.set(modifier, managerFactory);
return modifier;
};

let getModifierManager = obj => {
Expand Down

0 comments on commit bab5df6

Please sign in to comment.