diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js')
-rw-r--r-- | spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js b/spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js deleted file mode 100644 index e16c897a49b..00000000000 --- a/spec/frontend/vue_mr_widget/components/states/mr_widget_merging_spec.js +++ /dev/null @@ -1,74 +0,0 @@ -import { shallowMount } from '@vue/test-utils'; -import simplePoll from '~/lib/utils/simple_poll'; -import MrWidgetMerging from '~/vue_merge_request_widget/components/states/mr_widget_merging.vue'; - -jest.mock('~/lib/utils/simple_poll', () => - jest.fn().mockImplementation(jest.requireActual('~/lib/utils/simple_poll').default), -); - -describe('MRWidgetMerging', () => { - let wrapper; - - const GlEmoji = { template: '<img />' }; - beforeEach(() => { - wrapper = shallowMount(MrWidgetMerging, { - propsData: { - mr: { - targetBranchPath: '/branch-path', - targetBranch: 'branch', - transitionStateMachine() {}, - }, - service: { - poll: jest.fn().mockResolvedValue(), - }, - }, - stubs: { - GlEmoji, - }, - }); - }); - - afterEach(() => { - wrapper.destroy(); - }); - - it('renders information about merge request being merged', () => { - expect( - wrapper - .find('.media-body') - .text() - .trim() - .replace(/\s\s+/g, ' ') - .replace(/[\r\n]+/g, ' '), - ).toContain('Merging!'); - }); - - it('renders branch information', () => { - expect( - wrapper - .find('.mr-info-list') - .text() - .trim() - .replace(/\s\s+/g, ' ') - .replace(/[\r\n]+/g, ' '), - ).toEqual('Merges changes into branch'); - - expect(wrapper.find('a').attributes('href')).toBe('/branch-path'); - }); - - describe('initiateMergePolling', () => { - it('should call simplePoll', () => { - wrapper.vm.initiateMergePolling(); - - expect(simplePoll).toHaveBeenCalledWith(expect.any(Function), { timeout: 0 }); - }); - - it('should call handleMergePolling', () => { - jest.spyOn(wrapper.vm, 'handleMergePolling').mockImplementation(() => {}); - - wrapper.vm.initiateMergePolling(); - - expect(wrapper.vm.handleMergePolling).toHaveBeenCalled(); - }); - }); -}); |