diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/frontend/branches/branches_delete_modal_spec.js | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/frontend/branches/branches_delete_modal_spec.js')
-rw-r--r-- | spec/frontend/branches/branches_delete_modal_spec.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/frontend/branches/branches_delete_modal_spec.js b/spec/frontend/branches/branches_delete_modal_spec.js deleted file mode 100644 index 8b10cca7a11..00000000000 --- a/spec/frontend/branches/branches_delete_modal_spec.js +++ /dev/null @@ -1,40 +0,0 @@ -import $ from 'jquery'; -import DeleteModal from '~/branches/branches_delete_modal'; - -describe('branches delete modal', () => { - describe('setDisableDeleteButton', () => { - let submitSpy; - let $deleteButton; - - beforeEach(() => { - setFixtures(` - <div id="modal-delete-branch"> - <form> - <button type="submit" class="js-delete-branch">Delete</button> - </form> - </div> - `); - $deleteButton = $('.js-delete-branch'); - submitSpy = jest.fn((event) => event.preventDefault()); - $('#modal-delete-branch form').on('submit', submitSpy); - // eslint-disable-next-line no-new - new DeleteModal(); - }); - - it('does not submit if button is disabled', () => { - $deleteButton.attr('disabled', true); - - $deleteButton.click(); - - expect(submitSpy).not.toHaveBeenCalled(); - }); - - it('submits if button is not disabled', () => { - $deleteButton.attr('disabled', false); - - $deleteButton.click(); - - expect(submitSpy).toHaveBeenCalled(); - }); - }); -}); |