Fix automatically switching to the EDIT patchset if it exists

Going to the ,edit URL means that you want to enter edit mode. If you
do not qualify a patchset (i.e. .../edit or .../6 in the URL), then we
assume that you want to continue editing the your edit, if it already
exists.

We cannot use `_patchRange.patchNum` anymore for checking whether the
user did not specify a patchset in the URL, because the timing has
changed and we are updating `_patchRange.patchNum` to the latest
patchset of the change before the code is executed. So we have to
inspect the routerPatchNum directly.

Bug: Issue 15353
Change-Id: I4a11eccddce98029d5d579d79009fcca4c27d8b3
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.ts b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.ts
index 611537e..69cca9f 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.ts
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view_test.ts
@@ -1847,6 +1847,7 @@
 
     // When edit is set, but patchNum as well, then keep patchNum.
     element._patchRange.patchNum = 5 as RevisionPatchSetNum;
+    element.routerPatchNum = 5 as RevisionPatchSetNum;
     element._processEdit(change);
     assert.equal(element._patchRange.patchNum, 5 as RevisionPatchSetNum);
   });