summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html
diff options
context:
space:
mode:
Diffstat (limited to 'polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html')
-rw-r--r--polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html b/polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html
index 2915e296d2..ee284b9b24 100644
--- a/polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html
+++ b/polygerrit-ui/app/elements/change/gr-download-dialog/gr-download-dialog_test.html
@@ -45,6 +45,9 @@ limitations under the License.
revisions: {
'34685798fe548b6d17d1e8e5edc43a26d055cc72': {
_number: 1,
+ commit: {
+ parents: [],
+ },
fetch: {
repo: {
commands: {
@@ -105,6 +108,9 @@ limitations under the License.
revisions: {
'34685798fe548b6d17d1e8e5edc43a26d055cc72': {
_number: 1,
+ commit: {
+ parents: [],
+ },
fetch: {},
},
},
@@ -188,5 +194,25 @@ limitations under the License.
assert.equal(element._computeShowDownloadCommands([]), 'hidden');
assert.equal(element._computeShowDownloadCommands(['test']), '');
});
+
+ test('_computeHidePatchFile', () => {
+ const patchNum = '1';
+
+ const change1 = {
+ revisions: {
+ r1: {_number: 1, commit: {parents: []}},
+ },
+ };
+ assert.isTrue(element._computeHidePatchFile(change1, patchNum));
+
+ const change2 = {
+ revisions: {
+ r1: {_number: 1, commit: {parents: [
+ {commit: 'p1'},
+ ]}},
+ },
+ };
+ assert.isFalse(element._computeHidePatchFile(change2, patchNum));
+ });
});
</script>