Revert "Remove frontend redirection of legacy URIs without project"
This reverts commit a4f6c029c20aa8241ca686700c6340afdbe5031d.
Reason for revert: chromium-review is still using legacy URIs
Google-Bug-Id: b/307509411
Change-Id: I15b7060384109087dc63c08708dccb7e3ef773a1
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts
index c4fb259..234bf95 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts
@@ -168,11 +168,13 @@
const unauthenticatedHandlers = [
'handleBranchListRoute',
'handleChangeIdQueryRoute',
+ 'handleChangeNumberLegacyRoute',
'handleChangeRoute',
'handleCommentRoute',
'handleCommentsRoute',
'handleDiffRoute',
'handleDefaultRoute',
+ 'handleChangeLegacyRoute',
'handleDocumentationRedirectRoute',
'handleDocumentationSearchRoute',
'handleDocumentationSearchRedirectRoute',
@@ -851,6 +853,21 @@
});
suite('CHANGE* / DIFF*', () => {
+ test('CHANGE_NUMBER_LEGACY', async () => {
+ // CHANGE_NUMBER_LEGACY: /^\/(\d+)\/?/,
+ await checkRedirect('/12345', '/c/12345');
+ });
+
+ test('CHANGE_LEGACY', async () => {
+ // CHANGE_LEGACY: /^\/c\/(\d+)\/?(.*)$/,
+ stubRestApi('getFromProjectLookup').resolves('project' as RepoName);
+ await checkRedirect('/c/1234', '/c/project/+/1234/');
+ await checkRedirect(
+ '/c/1234/comment/6789',
+ '/c/project/+/1234/comment/6789'
+ );
+ });
+
test('DIFF_LEGACY_LINENUM', async () => {
await checkRedirect(
'/c/1234/3..8/foo/bar@321',