diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 4fc571ba51d8a..5f39415e1e92f 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -131,8 +131,9 @@ const uploadPipeline = (pipelineContent: string | object) => { } if ( - (await doAnyChangesMatch([/^x-pack\/plugins\/osquery/, /^x-pack\/test\/osquery_cypress/])) || - GITHUB_PR_LABELS.includes('ci:all-cypress-suites') + ((await doAnyChangesMatch([/^x-pack\/plugins\/osquery/, /^x-pack\/test\/osquery_cypress/])) || + GITHUB_PR_LABELS.includes('ci:all-cypress-suites')) && + !GITHUB_PR_LABELS.includes('ci:skip-cypress-osquery') ) { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/osquery_cypress.yml')); } diff --git a/x-pack/plugins/cases/public/common/use_cases_toast.tsx b/x-pack/plugins/cases/public/common/use_cases_toast.tsx index 3d90005546464..fd143345e2deb 100644 --- a/x-pack/plugins/cases/public/common/use_cases_toast.tsx +++ b/x-pack/plugins/cases/public/common/use_cases_toast.tsx @@ -169,6 +169,13 @@ export const useCasesToast = () => { showSuccessToast: (title: string) => { toasts.addSuccess({ title, className: 'eui-textBreakWord' }); }, + showInfoToast: (title: string, text?: string) => { + toasts.addInfo({ + title, + text, + className: 'eui-textBreakWord', + }); + }, }; }; diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/use_cases_add_to_existing_case_modal.test.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/use_cases_add_to_existing_case_modal.test.tsx index 5b921efca97bd..e98397d8bb37e 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/use_cases_add_to_existing_case_modal.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/use_cases_add_to_existing_case_modal.test.tsx @@ -20,6 +20,7 @@ import { useCreateAttachments } from '../../../containers/use_create_attachments import { CasesContext } from '../../cases_context'; import { CasesContextStoreActionsList } from '../../cases_context/cases_context_reducer'; import { ExternalReferenceAttachmentTypeRegistry } from '../../../client/attachment_framework/external_reference_registry'; +import type { AddToExistingCaseModalProps } from './use_cases_add_to_existing_case_modal'; import { useCasesAddToExistingCaseModal } from './use_cases_add_to_existing_case_modal'; import { PersistableStateAttachmentTypeRegistry } from '../../../client/attachment_framework/persistable_state_registry'; @@ -33,15 +34,18 @@ jest.mock('./all_cases_selector_modal', () => { }); const onSuccess = jest.fn(); +const getAttachments = jest.fn().mockReturnValue([alertComment]); const useCasesToastMock = useCasesToast as jest.Mock; const AllCasesSelectorModalMock = AllCasesSelectorModal as unknown as jest.Mock; // test component to test the hook integration -const TestComponent: React.FC = () => { - const hook = useCasesAddToExistingCaseModal({ onSuccess }); +const TestComponent: React.FC = ( + props: AddToExistingCaseModalProps = {} +) => { + const hook = useCasesAddToExistingCaseModal({ onSuccess, ...props }); const onClick = () => { - hook.open({ attachments: [alertComment] }); + hook.open({ getAttachments }); }; return