-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don’t stop iteration on first :class
Fix for issue #11193
- Loading branch information
1 parent
28d4c06
commit dccea5f
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/ember-htmlbars/tests/integration/component_class_name_bindings_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters