From db4dbf8f8a0438898c6ff16293c9552c992c5edf Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Wed, 14 Nov 2018 10:37:36 -0800 Subject: [PATCH] Add tests * When extended, a behavior `registered` is always called on sub-most prototype rather than the prototype on which `registered` was defined. * behavior property default values are overwritten by later behaviors and elements * readOnly properties ignored when a previous behavior observes the property * observedAttributes when extended --- test/unit/behaviors.html | 64 ++++++++++++++++++++++++++++++++++ test/unit/mixin-behaviors.html | 57 ++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/test/unit/behaviors.html b/test/unit/behaviors.html index 3051454e8d..a879c97ac6 100644 --- a/test/unit/behaviors.html +++ b/test/unit/behaviors.html @@ -395,6 +395,45 @@ zot: 'zot' }); + Polymer({ + is: 'override-default-value', + behaviors: [ + { + properties: { + foo: { value: true }, + bar: { value: true} + } + }, + { + properties: { + foo: { value: true }, + bar: String, + zot: {value: true} + } + }, + + ], + + properties: { + foo: String, + zot: String + } + }); + + Polymer({ + is: 'property-observer-readonly', + behaviors: [ + { + observers: ['_changed(bar)'], + _changed() {} + } + ], + + properties: { + bar: {readOnly: true} + } + }); + }); @@ -470,6 +509,18 @@ + + + + + + + + @@ -436,6 +467,19 @@ + + + + + + + + +