Skip to content

Commit

Permalink
Don’t stop iteration on first :class
Browse files Browse the repository at this point in the history
Fix for issue #11193
  • Loading branch information
mitchlloyd committed May 17, 2015
1 parent 28d4c06 commit dccea5f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import EmberView from "ember-views/views/view";
import { Registry } from "ember-runtime/system/container";
import compile from 'ember-template-compiler/system/compile';
import { runAppend, runDestroy } from "ember-runtime/tests/utils";
import ComponentLookup from 'ember-views/component_lookup';
import Component from "ember-views/views/component";

var registry, container, view;

QUnit.module('ember-htmlbars: component classNameBindings', {
setup() {
registry = new Registry();
container = registry.container();
registry.optionsForType('component', { singleton: false });
registry.optionsForType('view', { singleton: false });
registry.optionsForType('template', { instantiate: false });
registry.optionsForType('helper', { instantiate: false });
registry.register('component-lookup:main', ComponentLookup);
},

teardown() {
runDestroy(container);
runDestroy(view);
registry = container = view = null;
}
});

QUnit.test('using many class namebindings', function() {
registry.register('component:x-foo', Component.extend({
elementId: 'component',
classNameBindings: [':class-one', ':class-two']
}));

view = EmberView.create({
container: container,
template: compile('{{x-foo}}')
});

runAppend(view);
let classes = view.$('#component').attr('class');
equal(classes, 'ember-view class-one class-two');
});
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function normalizeClasses(classes, output) {
// Legacy :class microsyntax for static class names
if (propName === '') {
output.push(activeClass);
return;
continue;
}

// 2.0TODO: Remove deprecated global path
Expand Down

0 comments on commit dccea5f

Please sign in to comment.