diff options
author | Sam Bigelow <sbigelow@gitlab.com> | 2018-12-13 16:27:23 -0500 |
---|---|---|
committer | Sam Bigelow <sbigelow@gitlab.com> | 2018-12-13 16:30:07 -0500 |
commit | 5ee5203d6043807f28cca30c8358c0f0885bb305 (patch) | |
tree | d8f1ff322020f4cce3eab152e596bb86a77158b0 /spec/javascripts/blob_edit | |
parent | 07e079e8dd336e76986ad001fce79ab9babb00b0 (diff) | |
download | gitlab-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.js | 7 |
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(); + }); }); |