diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 15:07:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-16 15:07:11 +0300 |
commit | d87800c3cfa21bde64704542d61a587c5ff4306e (patch) | |
tree | 4921659e458ef0b21a637ba68a2765c93e4f20b7 /spec/frontend/vue_merge_request_widget | |
parent | 8ae36d93f1a63874b584f0488fde88c1fee999c4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_merge_request_widget')
-rw-r--r-- | spec/frontend/vue_merge_request_widget/components/approvals/approvals_spec.js | 8 | ||||
-rw-r--r-- | spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js | 16 |
2 files changed, 7 insertions, 17 deletions
diff --git a/spec/frontend/vue_merge_request_widget/components/approvals/approvals_spec.js b/spec/frontend/vue_merge_request_widget/components/approvals/approvals_spec.js index 724f9ea0346..2aed037be6f 100644 --- a/spec/frontend/vue_merge_request_widget/components/approvals/approvals_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/approvals/approvals_spec.js @@ -243,10 +243,6 @@ describe('MRWidget approvals', () => { it('calls service approve', () => { expect(service.approveMergeRequest).toHaveBeenCalled(); }); - - it('emits to eventHub', () => { - expect(eventHub.$emit).toHaveBeenCalledWith('MRWidgetUpdateRequested'); - }); }); describe('and error', () => { @@ -297,10 +293,6 @@ describe('MRWidget approvals', () => { it('calls service unapprove', () => { expect(service.unapproveMergeRequest).toHaveBeenCalled(); }); - - it('emits to eventHub', () => { - expect(eventHub.$emit).toHaveBeenCalledWith('MRWidgetUpdateRequested'); - }); }); describe('and error', () => { diff --git a/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js b/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js index 4161d51526f..0533471bece 100644 --- a/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js +++ b/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js @@ -31,6 +31,7 @@ import WidgetContainer from '~/vue_merge_request_widget/components/widget/app.vu import StatusIcon from '~/vue_merge_request_widget/components/extensions/status_icon.vue'; import getStateQuery from '~/vue_merge_request_widget/queries/get_state.query.graphql'; import getStateSubscription from '~/vue_merge_request_widget/queries/get_state.subscription.graphql'; +import readyToMergeSubscription from '~/vue_merge_request_widget/queries/states/ready_to_merge.subscription.graphql'; import readyToMergeQuery from 'ee_else_ce/vue_merge_request_widget/queries/states/ready_to_merge.query.graphql'; import approvalsQuery from 'ee_else_ce/vue_merge_request_widget/components/approvals/queries/approvals.query.graphql'; import approvedBySubscription from 'ee_else_ce/vue_merge_request_widget/components/approvals/queries/approvals.subscription.graphql'; @@ -70,6 +71,7 @@ describe('MrWidgetOptions', () => { let queryResponse; let wrapper; let mock; + let stateSubscription; const COLLABORATION_MESSAGE = 'Members who can merge are allowed to add commits'; const findApprovalsWidget = () => wrapper.findComponent(Approvals); @@ -110,6 +112,7 @@ describe('MrWidgetOptions', () => { }, }; stateQueryHandler = jest.fn().mockResolvedValue(queryResponse); + stateSubscription = createMockApolloSubscription(); const mounting = fullMount ? mount : shallowMount; const queryHandlers = [ @@ -130,6 +133,8 @@ describe('MrWidgetOptions', () => { ]; const subscriptionHandlers = [ [approvedBySubscription, () => mockedApprovalsSubscription], + [getStateSubscription, () => stateSubscription], + [readyToMergeSubscription, () => createMockApolloSubscription()], ...(options.apolloSubscriptions || []), ]; const apolloProvider = createMockApollo(queryHandlers); @@ -1262,11 +1267,8 @@ describe('MrWidgetOptions', () => { }); describe('when the MR is updated by observing its status', () => { - let stateSubscription; - beforeEach(() => { window.gon.features.realtimeMrStatusChange = true; - stateSubscription = createMockApolloSubscription(); }); it("shows the Preparing widget when the MR reports it's not ready yet", async () => { @@ -1276,9 +1278,7 @@ describe('MrWidgetOptions', () => { state: 'opened', detailedMergeStatus: 'PREPARING', }, - { - apolloSubscriptions: [[getStateSubscription, () => stateSubscription]], - }, + {}, {}, false, ); @@ -1293,9 +1293,7 @@ describe('MrWidgetOptions', () => { state: 'opened', detailedMergeStatus: 'PREPARING', }, - { - apolloSubscriptions: [[getStateSubscription, () => stateSubscription]], - }, + {}, {}, false, ); |