From fd9ffb5870ae726b7d070bce2b77a33cb5a77edc Mon Sep 17 00:00:00 2001 From: Tao Zhou Date: Fri, 20 Sep 2019 13:05:46 +0200 Subject: [PATCH] Fix failing tests for gr-diff-host Change-Id: I15c2e2312edaf413e242ce7ba83ae7a61b130db5 --- .../app/elements/diff/gr-diff-host/gr-diff-host_test.html | 5 +++++ polygerrit-ui/app/test/index.html | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.html b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.html index 65d81bfc92..104c0c27b3 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.html +++ b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.html @@ -305,6 +305,7 @@ limitations under the License. // Stub the network calls into requests that never resolve. sandbox.stub(element, '_getDiff', () => new Promise(() => {})); + element.patchRange = {}; element.reload(); assert.isTrue(cancelStub.called); @@ -368,6 +369,7 @@ limitations under the License. (changeNum, basePatchNum, patchNum, path, onErr) => { onErr(error); }); + element.patchRange = {}; return element.reload().then(() => { assert.isTrue(onErrStub.calledOnce); }); @@ -725,6 +727,7 @@ limitations under the License. test('delegates cancel()', () => { const stub = sandbox.stub(element.$.diff, 'cancel'); + element.patchRange = {}; element.reload(); assert.isTrue(stub.calledOnce); assert.equal(stub.lastCall.args.length, 0); @@ -1243,9 +1246,11 @@ limitations under the License. const l = document.createElement('div'); l.setAttribute('comment-side', 'left'); + l.setAttribute('line-num', 'FILE'); const r = document.createElement('div'); r.setAttribute('comment-side', 'right'); + r.setAttribute('line-num', 'FILE'); const threadEls = [l, r]; assert.deepEqual(element._filterThreadElsForLocation(threadEls, line), diff --git a/polygerrit-ui/app/test/index.html b/polygerrit-ui/app/test/index.html index 6cdac42d72..f5a64dcf1d 100644 --- a/polygerrit-ui/app/test/index.html +++ b/polygerrit-ui/app/test/index.html @@ -111,8 +111,7 @@ limitations under the License. 'diff/gr-diff-cursor/gr-diff-cursor_test.html', 'diff/gr-diff-highlight/gr-annotation_test.html', 'diff/gr-diff-highlight/gr-diff-highlight_test.html', - // TODO: uncomment file & fix tests. The file was missed in this list for a long time. - // 'diff/gr-diff-host/gr-diff-host_test.html', + 'diff/gr-diff-host/gr-diff-host_test.html', 'diff/gr-diff-mode-selector/gr-diff-mode-selector_test.html', 'diff/gr-diff-processor/gr-diff-processor_test.html', 'diff/gr-diff-selection/gr-diff-selection_test.html',