summaryrefslogtreecommitdiff
path: root/spec/javascripts/blob_edit
diff options
context:
space:
mode:
authorSam Bigelow <sbigelow@gitlab.com>2018-12-13 16:27:23 -0500
committerSam Bigelow <sbigelow@gitlab.com>2018-12-13 16:30:07 -0500
commit5ee5203d6043807f28cca30c8358c0f0885bb305 (patch)
treed8f1ff322020f4cce3eab152e596bb86a77158b0 /spec/javascripts/blob_edit
parent07e079e8dd336e76986ad001fce79ab9babb00b0 (diff)
downloadgitlab-ce-5ee5203d6043807f28cca30c8358c0f0885bb305.tar.gz
Remove beforeunload listener for cancel button
Diffstat (limited to 'spec/javascripts/blob_edit')
-rw-r--r--spec/javascripts/blob_edit/blob_bundle_spec.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/javascripts/blob_edit/blob_bundle_spec.js b/spec/javascripts/blob_edit/blob_bundle_spec.js
index 759d170af77..57f60a4a3dd 100644
--- a/spec/javascripts/blob_edit/blob_bundle_spec.js
+++ b/spec/javascripts/blob_edit/blob_bundle_spec.js
@@ -14,6 +14,7 @@ describe('EditBlob', () => {
setFixtures(`
<div class="js-edit-blob-form">
<button class="js-commit-button"></button>
+ <a class="btn btn-cancel" href="#"></a>
</div>`);
blobBundle();
});
@@ -27,4 +28,10 @@ describe('EditBlob', () => {
expect(window.onbeforeunload).toBeNull();
});
+
+ it('removes beforeunload listener when cancel link is clicked', () => {
+ $('.btn.btn-cancel').click();
+
+ expect(window.onbeforeunload).toBeNull();
+ });
});