Recreate complex properties per element

Turns out assigning just some value to value means it is reused across
instances of the custom element, causing all kinds of funny behavior and
confusion in tests.

Change-Id: Ia4ff4f8493f6fcc81bc7ed18f8b5858cb96c9e08
This commit is contained in:
Ole Rehmsen
2018-11-15 20:43:05 +01:00
parent cdcdd82f9c
commit e4d06928e2
4 changed files with 3 additions and 5 deletions

View File

@@ -113,6 +113,7 @@ limitations under the License.
/** @type {!Array<!Gerrit.HoveredRange>} */
commentRanges: {
type: Array,
value: () => [],
},
},

View File

@@ -199,7 +199,7 @@
_threadEls: {
type: Array,
value: [],
value: () => [],
},
},

View File

@@ -46,9 +46,6 @@ limitations under the License.
async getLoggedIn() { return getLoggedIn; },
});
element = fixture('basic');
// For reasons beyond me, fixture reuses elements, cleans out some
// stuff but not that list.
element._threadEls = [];
});
teardown(() => {

View File

@@ -120,7 +120,7 @@
/** @type {!Array<!Gerrit.HoveredRange>} */
_commentRanges: {
type: Array,
value: [],
value: () => [],
},
lineWrapping: {
type: Boolean,