Skip to content

Commit 0205678

Browse files
committed
Fix bug in property lookup. Add test.
1 parent 8ea8ecf commit 0205678

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

src/micro/properties.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
var info = this._getPropertyInfo(property, this.properties);
6666
if (!info) {
6767
this.behaviors.some(function(b) {
68-
var info = this._getPropertyInfo(property, b.properties);
68+
return info = this._getPropertyInfo(property, b.properties);
6969
}, this);
7070
}
7171
return info || Polymer.nob;

test/unit/behaviors-elements.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
label: {
1818
type: String,
1919
observer: '_labelChanged'
20+
},
21+
22+
hasOptionsA: {
23+
readOnly: true,
24+
notify: true
2025
}
2126

2227
},
@@ -37,7 +42,7 @@
3742
this.__change = e.detail.value;
3843
}
3944

40-
}
45+
};
4146

4247
</script>
4348

@@ -51,6 +56,11 @@
5156
type: Boolean,
5257
value: false,
5358
observer: '_disabledChanged'
59+
},
60+
61+
hasOptionsB: {
62+
readOnly: true,
63+
notify: true
5464
}
5565

5666
},

test/unit/behaviors.html

+18
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
assert.equal(el.__change, 'bar');
4747
});
4848

49+
test('property info from behavior A', function() {
50+
assert.equal(el.getPropertyInfo('hasOptionsA').notify, true);
51+
assert.equal(el.getPropertyInfo('hasOptionsA').readOnly, true);
52+
assert.equal(typeof el._setHasOptionsA, 'function');
53+
});
54+
4955
});
5056

5157
suite('multi-behaviors element', function() {
@@ -85,6 +91,18 @@
8591
assert.equal(el.__change, 'bar');
8692
});
8793

94+
test('property info from behavior A', function() {
95+
assert.equal(el.getPropertyInfo('hasOptionsA').notify, true);
96+
assert.equal(el.getPropertyInfo('hasOptionsA').readOnly, true);
97+
assert.equal(typeof el._setHasOptionsA, 'function');
98+
});
99+
100+
test('property info from behavior B', function() {
101+
assert.equal(el.getPropertyInfo('hasOptionsB').readOnly, true);
102+
assert.equal(el.getPropertyInfo('hasOptionsB').notify, true);
103+
assert.equal(typeof el._setHasOptionsB, 'function');
104+
});
105+
88106
});
89107

90108
</script>

0 commit comments

Comments
 (0)