Skip to content

Commit

Permalink
Fix gr-diff-builder tests in Polymer 2
Browse files Browse the repository at this point in the history
Polymer 2 doesn't support binding in test-fixture (see
PolymerElements/test-fixture#47).
Another problem that pluginLayers can be set null - additional
check was added.

Change-Id: I48c3fbaab6763867bd872ba10507a6dbd7ddf732
  • Loading branch information
gdmfilippov committed Sep 25, 2019
1 parent a5dd85e commit 4d7fe0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@
this.$.coverageLayerLeft,
this.$.coverageLayerRight,
];
layers.push(...this.pluginLayers);

if (this.pluginLayers) {
layers.push(...this.pluginLayers);
}
this._layers = layers;
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<test-fixture id="basic">
<template is="dom-template">
<gr-diff-builder plugin-layers="[[pluginLayers]]">
<gr-diff-builder>
<table id="diffTable"></table>
</gr-diff-builder>
</template>
Expand Down Expand Up @@ -596,7 +596,8 @@
let withPluginLayerCount;
setup(() => {
const pluginLayers = [];
element = fixture('basic', {pluginLayers});
element = fixture('basic');
element.pluginLayers = pluginLayers;
element._showTrailingWhitespace = true;
element._setupAnnotationLayers();
initialLayersCount = element._layers.length;
Expand All @@ -610,7 +611,8 @@
suite('with plugin layers', () => {
const pluginLayers = [{}, {}];
setup(() => {
element = fixture('basic', {pluginLayers});
element = fixture('basic');
element.pluginLayers = pluginLayers;
element._showTrailingWhitespace = true;
element._setupAnnotationLayers();
withPluginLayerCount = element._layers.length;
Expand Down

0 comments on commit 4d7fe0b

Please sign in to comment.