Skip to content
Snippets Groups Projects
Unverified Commit 63c505c9 authored by David Pisek's avatar David Pisek Committed by GitLab
Browse files

Merge branch...

Merge branch '499275-close-finding-modal-after-the-ai-comment-has-successfully-been-added' into 'master' 

Vuln-Finding: Close modal after AI-resolve

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169319



Merged-by: default avatarDavid Pisek <dpisek@gitlab.com>
Approved-by: default avatarSamantha Ming <sming@gitlab.com>
parents 0bdd9f8f 3fe24684
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -68,6 +68,7 @@ export default {
this.handleError(errors[0]);
} else if (content) {
this.stopResolveWithAISubscription();
this.$emit('success');
visitUrl(content);
}
},
Loading
Loading
Loading
Loading
@@ -729,6 +729,7 @@ export default {
:finding-uuid="findingUuid"
:merge-request-id="mergeRequestId"
@error="handleResolveWithAiError"
@success="closeModal"
/>
</template>
</gl-modal>
Loading
Loading
Loading
Loading
@@ -191,6 +191,19 @@ describe('ee/security_dashboard/components/pipeline/resolve_with_ai_button.vue',
expect(MUTATION_AI_ACTION_DEFAULT_RESPONSE).toHaveBeenCalled();
});
 
it('emits a "success" event when the subscription response returns the correct content', async () => {
createWrapperWithApollo();
clickButton();
expect(wrapper.emitted('success')).toBeUndefined();
sendSubscriptionMessage(getAiSubscriptionResponse());
await waitForPromises();
expect(wrapper.emitted('success')).toHaveLength(1);
});
it('redirects to the given URL when the subscription response returns the correct content', async () => {
createWrapperWithApollo();
 
Loading
Loading
Loading
Loading
@@ -1686,6 +1686,14 @@ describe('ee/security_dashboard/components/pipeline/vulnerability_finding_modal.
});
});
 
it('closes the modal when the "success" event is emitted', () => {
expectModalToBeHiddenAfter({
action: () => {
findResolveWithAIButton().vm.$emit('success');
},
});
});
it('shows the error alert when the "error" event is emitted', async () => {
expect(findErrorAlert().exists()).toBe(false);
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment