diff --git a/src/micro/behaviors.html b/src/micro/behaviors.html index 55cf220ff9..c3420ff47a 100644 --- a/src/micro/behaviors.html +++ b/src/micro/behaviors.html @@ -53,7 +53,7 @@ var flat = []; behaviors.forEach(function(b) { if (b instanceof Array) { - flat = flat.concat(b); + flat = flat.concat(this._flattenBehaviorsList(b)); } else { flat.push(b); } diff --git a/test/unit/behaviors-elements.html b/test/unit/behaviors-elements.html index 984339c506..d186c4d7ec 100644 --- a/test/unit/behaviors-elements.html +++ b/test/unit/behaviors-elements.html @@ -26,6 +26,10 @@ overridableProperty: { value: false + }, + + hasBehaviorA: { + value: true } }, @@ -68,6 +72,10 @@ hasOptionsB: { readOnly: true, notify: true + }, + + hasBehaviorB: { + value: true } }, @@ -106,8 +114,6 @@ + + + + + + + + \ No newline at end of file diff --git a/test/unit/behaviors.html b/test/unit/behaviors.html index 3789ecc769..9e45423334 100644 --- a/test/unit/behaviors.html +++ b/test/unit/behaviors.html @@ -109,6 +109,29 @@ }); }); + +suite('nexted-behaviors element', function() { + + var el; + + setup(function() { + el = document.createElement('nested-behaviors'); + document.body.appendChild(el); + }); + + teardown(function() { + document.body.removeChild(el); + }); + + test('properties from nested behaviors', function() { + assert.ok(el.hasBehaviorA, "missing BehaviorA"); + assert.ok(el.hasBehaviorB, "missing BehaviorB"); + assert.ok(el.hasBehaviorC, "missing BehaviorC"); + assert.ok(el.hasBehaviorD, "missing BehaviorD"); + }); + +}); +