diff --git a/addon/resolvers/classic/index.js b/addon/resolvers/classic/index.js index e80f605a..7643470b 100644 --- a/addon/resolvers/classic/index.js +++ b/addon/resolvers/classic/index.js @@ -197,6 +197,7 @@ const Resolver = EmberObject.extend({ if ( type === 'component' || type === 'helper' || + type === 'modifier' || (type === 'template' && split[1].indexOf('components/') === 0) ) { return type + ':' + split[1].replace(/_/g, '-'); diff --git a/tests/unit/resolvers/classic/basic-test.js b/tests/unit/resolvers/classic/basic-test.js index c3066974..2428ff7b 100644 --- a/tests/unit/resolvers/classic/basic-test.js +++ b/tests/unit/resolvers/classic/basic-test.js @@ -545,6 +545,34 @@ test('normalization', function(assert) { assert.equal(resolver.normalize('component:fabulous-component'), 'component:fabulous-component'); assert.equal(resolver.normalize('component:fabulousComponent'), 'component:fabulousComponent'); assert.equal(resolver.normalize('template:components/fabulousComponent'), 'template:components/fabulousComponent'); + + // and modifiers + assert.equal(resolver.normalize('modifier:fabulous-component'), 'modifier:fabulous-component'); + + // deprecated when fabulously-missing actually exists, but normalize still returns it + assert.equal(resolver.normalize('modifier:fabulouslyMissing'), 'modifier:fabulouslyMissing'); +}); + +test('camel case modifier is not normalized', function(assert) { + assert.expect(2); + + let expected = { }; + define('appkit/modifiers/other-thing', [], function(){ + assert.ok(false, 'appkit/modifiers/other-thing was accessed'); + + return { default: 'oh no' }; + }); + + define('appkit/modifiers/otherThing', [], function(){ + assert.ok(true, 'appkit/modifiers/otherThing was accessed'); + + return { default: expected }; + }); + + + let modifier = resolver.resolve('modifier:otherThing'); + + assert.strictEqual(modifier, expected); }); test('normalization is idempotent', function(assert) {