Fix edit diff url

This fixes an issue where a user presses "edit" expecting them to be
taken to either the edit they started or to start a new edit based
on the latest commit.

Change-Id: I296e860aaebfde8b8dc1bd8a72d52c1db37d9097
This commit is contained in:
Paladox none
2020-05-11 14:23:37 +00:00
parent 2d927aa8f6
commit 59c52e00fa
2 changed files with 4 additions and 2 deletions

View File

@@ -538,8 +538,7 @@
_goToEditFile() {
// TODO(taoalpha): add a shortcut for editing
const editUrl = Gerrit.Nav.getEditUrlForDiff(
this._change, this._path, this._patchRange.patchNum);
const editUrl = Gerrit.Nav.getEditUrlForDiff(this._change, this._path);
return Gerrit.Nav.navigateToRelativeUrl(editUrl);
},

View File

@@ -378,6 +378,7 @@ limitations under the License.
};
element._change = {
_number: 42,
project: 'gerrit',
status: 'NEW',
revisions: {
a: {_number: 1, commit: {parents: []}},
@@ -391,6 +392,8 @@ limitations under the License.
assert.isTrue(!!editBtn);
MockInteractions.tap(editBtn);
assert.isTrue(redirectStub.called);
assert.isTrue(redirectStub.lastCall.calledWithExactly(
Gerrit.Nav.getEditUrlForDiff(element._change, element._path)));
done();
});
});