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:
@@ -113,6 +113,7 @@ limitations under the License.
|
||||
/** @type {!Array<!Gerrit.HoveredRange>} */
|
||||
commentRanges: {
|
||||
type: Array,
|
||||
value: () => [],
|
||||
},
|
||||
},
|
||||
|
||||
|
@@ -199,7 +199,7 @@
|
||||
|
||||
_threadEls: {
|
||||
type: Array,
|
||||
value: [],
|
||||
value: () => [],
|
||||
},
|
||||
},
|
||||
|
||||
|
@@ -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(() => {
|
||||
|
@@ -120,7 +120,7 @@
|
||||
/** @type {!Array<!Gerrit.HoveredRange>} */
|
||||
_commentRanges: {
|
||||
type: Array,
|
||||
value: [],
|
||||
value: () => [],
|
||||
},
|
||||
lineWrapping: {
|
||||
type: Boolean,
|
||||
|
Reference in New Issue
Block a user