Add shift+m shortcut to diff view Shift+m marks the current file as reviewed and navigates to the next unreviewed file. Bug: Issue 9280 Change-Id: I11ac225dfbfdf07b10b35297314031c48fd0799c
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html index 3a5ca51..0274330 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html +++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html
@@ -67,6 +67,7 @@ kb.bindShortcut(kb.Shortcut.EXPAND_ALL_DIFF_CONTEXT, 'shift+x'); kb.bindShortcut(kb.Shortcut.EXPAND_ALL_COMMENT_THREADS, 'e'); kb.bindShortcut(kb.Shortcut.COLLAPSE_ALL_COMMENT_THREADS, 'shift+e'); + kb.bindShortcut(kb.Shortcut.NEXT_UNREVIEWED_FILE, 'shift+m'); let element; let sandbox; @@ -1127,5 +1128,22 @@ assert.isTrue(setStub.calledOnce); assert.isTrue(setStub.calledWith(101, 'test-project')); }); + + test('shift+m navigates to next unreviewed file', () => { + element._fileList = ['file1', 'file2', 'file3']; + element._reviewedFiles = new Set(['file1', 'file2']); + element._path = 'file1'; + const reviewedStub = sandbox.stub(element, '_setReviewed'); + const navStub = sandbox.stub(element, '_navToFile'); + MockInteractions.pressAndReleaseKeyOn(element, 77, 'shift', 'm'); + flushAsynchronousOperations(); + + assert.isTrue(reviewedStub.lastCall.args[0]); + assert.deepEqual(navStub.lastCall.args, [ + 'file1', + ['file1', 'file3'], + 1, + ]); + }); }); </script>