From 6adbbae57615e3e5cc800ce0e4d496f3d651841f Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 17 Nov 2020 14:29:57 -0700 Subject: [PATCH 1/2] Upgrade EUI to v30.2.0 (#82730) * eui to v30.2.0 * src snapshot updates * x-pack euipanel snapshot updates * x-pack external link updates * security_solution_cypress external link text * clean up --- package.json | 2 +- .../dashboard_empty_screen.test.tsx.snap | 4 +- .../CustomLinkFlyout/link_preview.test.tsx | 15 ++++- .../__snapshots__/asset.stories.storyshot | 4 +- .../asset_manager.stories.storyshot | 6 +- .../custom_element_modal.stories.storyshot | 8 +-- .../element_card.stories.storyshot | 8 +-- .../element_grid.stories.storyshot | 6 +- .../saved_elements_modal.stories.storyshot | 8 +-- .../shape_picker_popover.stories.storyshot | 6 +- .../__snapshots__/settings.test.tsx.snap | 10 ++-- .../__snapshots__/policy_table.test.tsx.snap | 2 +- .../__snapshots__/add_license.test.js.snap | 4 +- .../request_trial_extension.test.js.snap | 8 +-- .../revert_to_basic.test.js.snap | 6 +- .../__snapshots__/start_trial.test.js.snap | 8 +-- .../upload_license.test.tsx.snap | 10 ++-- .../upgrade_failure.test.js.snap | 6 +- .../__snapshots__/no_data.test.js.snap | 4 +- .../__snapshots__/exporters.test.js.snap | 20 +++++++ .../__snapshots__/reason_found.test.js.snap | 20 +++++++ .../__snapshots__/page_loading.test.js.snap | 2 +- .../api_keys_grid_page.test.tsx.snap | 27 ++++++++- .../roles_grid_page.test.tsx.snap | 2 +- .../reset_session_page.test.tsx.snap | 2 +- .../common/shared_exports.ts | 2 +- .../security_solution/common/test_utils.ts | 6 ++ .../alerts_detection_rules_custom.spec.ts | 9 ++- .../alerts_detection_rules_eql.spec.ts | 9 ++- .../alerts_detection_rules_ml.spec.ts | 9 ++- .../alerts_detection_rules_override.spec.ts | 9 ++- .../alerts_detection_rules_threshold.spec.ts | 9 ++- .../cypress/screens/rule_details.ts | 3 + .../common/components/links/index.test.tsx | 11 ++-- .../markdown_editor/renderer.test.tsx | 7 ++- .../__snapshots__/index.test.tsx.snap | 10 ++++ .../__snapshots__/index.test.tsx.snap | 60 +++++++++---------- .../__snapshots__/index.test.tsx.snap | 2 +- .../network/components/port/index.test.tsx | 5 +- .../source_destination/index.test.tsx | 15 +++-- .../source_destination_ip.test.tsx | 25 +++++--- .../certificate_fingerprint/index.test.tsx | 9 ++- .../components/ja3_fingerprint/index.test.tsx | 7 ++- .../components/netflow/index.test.tsx | 45 ++++++++------ .../note_card_body.test.tsx.snap | 10 ++++ .../body/renderers/get_row_renderer.test.tsx | 7 ++- .../suricata/suricata_details.test.tsx | 3 +- .../suricata/suricata_row_renderer.test.tsx | 3 +- .../system/generic_row_renderer.test.tsx | 15 ++--- .../body/renderers/zeek/zeek_details.test.tsx | 11 ++-- .../renderers/zeek/zeek_row_renderer.test.tsx | 3 +- .../renderers/zeek/zeek_signature.test.tsx | 3 +- .../components/health_check.test.tsx | 14 +++-- .../__snapshots__/expanded_row.test.tsx.snap | 10 ++++ .../monitor_status.bar.test.tsx.snap | 10 ++++ .../__snapshots__/empty_state.test.tsx.snap | 8 +-- .../__snapshots__/monitor_list.test.tsx.snap | 2 +- yarn.lock | 8 +-- 58 files changed, 371 insertions(+), 186 deletions(-) diff --git a/package.json b/package.json index f7bd3432726d0..ea92d62368779 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "@elastic/datemath": "link:packages/elastic-datemath", "@elastic/elasticsearch": "7.10.0-rc.1", "@elastic/ems-client": "7.10.0", - "@elastic/eui": "30.1.1", + "@elastic/eui": "30.2.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/node-crypto": "1.2.1", diff --git a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap index 31ef011835917..dac84c87faf97 100644 --- a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -297,7 +297,7 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = ` paddingSize="none" >
+ str.replace(/\(opens in a new tab or window\)/g, ''); + describe('LinkPreview', () => { let callApmApiSpy: jest.SpyInstance; beforeAll(() => { @@ -53,7 +56,9 @@ describe('LinkPreview', () => { ); expect(getElementValue(container, 'preview-label')).toEqual('foo'); expect( - (getByTestId(container, 'preview-link') as HTMLAnchorElement).text + removeExternalLinkText( + (getByTestId(container, 'preview-link') as HTMLAnchorElement).text + ) ).toEqual('https://baz.co'); }); }); @@ -69,7 +74,9 @@ describe('LinkPreview', () => { ); expect(getElementValue(container, 'preview-label')).toEqual('foo'); expect( - (getByTestId(container, 'preview-link') as HTMLAnchorElement).text + removeExternalLinkText( + (getByTestId(container, 'preview-link') as HTMLAnchorElement).text + ) ).toEqual('https://baz.co?service.name={{invalid}'); expect(getByTestId(container, 'preview-warning')).toBeInTheDocument(); }); @@ -85,7 +92,9 @@ describe('LinkPreview', () => { await waitFor(() => expect(callApmApiSpy).toHaveBeenCalled()); expect(getElementValue(container, 'preview-label')).toEqual('foo'); expect( - (getByTestId(container, 'preview-link') as HTMLAnchorElement).text + removeExternalLinkText( + (getByTestId(container, 'preview-link') as HTMLAnchorElement).text + ) ).toEqual('https://baz.co?transaction=foo'); }); }); diff --git a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot index e62785272a5ec..05339ca558562 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot @@ -12,7 +12,7 @@ exports[`Storyshots components/Assets/Asset airplane 1`] = ` className="euiFlexItem" >
Hide Toolbar
Hide the toolbar when the mouse is not within the Canvas?
"`; +exports[` can navigate Toolbar Settings, closes when activated 3`] = `"
Settings
Hide Toolbar
Hide the toolbar when the mouse is not within the Canvas?
"`; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/components/__snapshots__/policy_table.test.tsx.snap b/x-pack/plugins/index_lifecycle_management/__jest__/components/__snapshots__/policy_table.test.tsx.snap index 06cd77558b443..ba2ec28bf6bc1 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/components/__snapshots__/policy_table.test.tsx.snap +++ b/x-pack/plugins/index_lifecycle_management/__jest__/components/__snapshots__/policy_table.test.tsx.snap @@ -50,7 +50,7 @@ exports[`policy table should show empty state when there are not any policies 1` class="euiPageBody" >
Update your license

If you already have a new license, upload it now.

"`; +exports[`AddLicense component when license is active should display correct verbiage 1`] = `"
Update your license

If you already have a new license, upload it now.

"`; -exports[`AddLicense component when license is expired should display with correct verbiage 1`] = `"
Update your license

If you already have a new license, upload it now.

"`; +exports[`AddLicense component when license is expired should display with correct verbiage 1`] = `"
Update your license

If you already have a new license, upload it now.

"`; diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/request_trial_extension.test.js.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/request_trial_extension.test.js.snap index db37bc6cb98c4..719fce35a2a68 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/request_trial_extension.test.js.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/request_trial_extension.test.js.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`RequestTrialExtension component should display when enterprise license is not active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features, request an extension now.

"`; +exports[`RequestTrialExtension component should display when enterprise license is not active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features(opens in a new tab or window), request an extension now.

"`; -exports[`RequestTrialExtension component should display when license is active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features, request an extension now.

"`; +exports[`RequestTrialExtension component should display when license is active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features(opens in a new tab or window), request an extension now.

"`; -exports[`RequestTrialExtension component should display when license is not active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features, request an extension now.

"`; +exports[`RequestTrialExtension component should display when license is not active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features(opens in a new tab or window), request an extension now.

"`; -exports[`RequestTrialExtension component should display when platinum license is not active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features, request an extension now.

"`; +exports[`RequestTrialExtension component should display when platinum license is not active and trial has been used 1`] = `"
Extend your trial

If you’d like to continue using machine learning, advanced security, and our other awesome subscription features(opens in a new tab or window), request an extension now.

"`; diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/revert_to_basic.test.js.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/revert_to_basic.test.js.snap index 24598635b28e3..a0f3948785a80 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/revert_to_basic.test.js.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/revert_to_basic.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`RevertToBasic component should display when license is about to expire 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features.

"`; +exports[`RevertToBasic component should display when license is about to expire 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; -exports[`RevertToBasic component should display when license is expired 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features.

"`; +exports[`RevertToBasic component should display when license is expired 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; -exports[`RevertToBasic component should display when trial is active 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features.

"`; +exports[`RevertToBasic component should display when trial is active 1`] = `"
Revert to Basic license

You’ll revert to our free features and lose access to machine learning, advanced security, and other subscription features(opens in a new tab or window).

"`; diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap index 24872a888b090..52a2da596c10e 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/start_trial.test.js.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`StartTrial component when trial is allowed display for basic license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features have to offer.

"`; +exports[`StartTrial component when trial is allowed display for basic license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; -exports[`StartTrial component when trial is allowed should display for expired enterprise license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features have to offer.

"`; +exports[`StartTrial component when trial is allowed should display for expired enterprise license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; -exports[`StartTrial component when trial is allowed should display for expired platinum license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features have to offer.

"`; +exports[`StartTrial component when trial is allowed should display for expired platinum license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; -exports[`StartTrial component when trial is allowed should display for gold license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features have to offer.

"`; +exports[`StartTrial component when trial is allowed should display for gold license 1`] = `"
Start a 30-day trial

Experience what machine learning, advanced security, and all our other subscription features(opens in a new tab or window) have to offer.

"`; diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap index 72c04992566bd..cc41a3a4b4e22 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap @@ -270,7 +270,7 @@ exports[`UploadLicense should display a modal when license requires acknowledgem paddingSize="l" >
cloud dashboard. + + + (opens in a new tab or window) + For more information on Monitoring in Elastic Cloud, please see the documentation. + + + (opens in a new tab or window) +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap index e7b88e23c5f68..9e3b7c0e25d5d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap @@ -185,6 +185,16 @@ Array [ target="_blank" > cloud dashboard. + + + (opens in a new tab or window) + For more information on Monitoring in Elastic Cloud, please see the documentation. + + + (opens in a new tab or window) +

diff --git a/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap b/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap index f4d8232b2e340..fa223a2fe57e1 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap @@ -9,7 +9,7 @@ exports[`PageLoading should show a simple page loading component 1`] = ` class="euiPageBody" >
docs + + + + + + + (opens in a new tab or window) + + + to enable API keys. @@ -119,7 +144,7 @@ exports[`APIKeysGridPage renders permission denied if user does not have require paddingSize="l" >
renders permission denied if required 1`] = ` paddingSize="l" >
MockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; +exports[`ResetSessionPage renders as expected 1`] = `"MockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; diff --git a/x-pack/plugins/security_solution/common/shared_exports.ts b/x-pack/plugins/security_solution/common/shared_exports.ts index bee2e54d0e3ea..fb457933f4b54 100644 --- a/x-pack/plugins/security_solution/common/shared_exports.ts +++ b/x-pack/plugins/security_solution/common/shared_exports.ts @@ -13,7 +13,7 @@ export { DefaultVersionNumberDecoded, } from './detection_engine/schemas/types/default_version_number'; export { exactCheck } from './exact_check'; -export { getPaths, foldLeftRight } from './test_utils'; +export { getPaths, foldLeftRight, removeExternalLinkText } from './test_utils'; export { validate, validateEither } from './validate'; export { formatErrors } from './format_errors'; export { migratePackagePolicyToV7110 } from './endpoint/policy/migrations/to_v7_11.0'; diff --git a/x-pack/plugins/security_solution/common/test_utils.ts b/x-pack/plugins/security_solution/common/test_utils.ts index b96639ad7b034..2cdce67f364dc 100644 --- a/x-pack/plugins/security_solution/common/test_utils.ts +++ b/x-pack/plugins/security_solution/common/test_utils.ts @@ -41,3 +41,9 @@ export const getPaths = (validation: t.Validation): string[] => { ) ); }; + +/** + * Convenience utility to remove text appended to links by EUI + */ +export const removeExternalLinkText = (str: string) => + str.replace(/\(opens in a new tab or window\)/g, ''); diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts index 783f8be840b7f..fb1f2920aaceb 100644 --- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts @@ -49,6 +49,7 @@ import { DEFINITION_DETAILS, FALSE_POSITIVES_DETAILS, getDetails, + removeExternalLinkText, INDEX_PATTERNS_DETAILS, INVESTIGATION_NOTES_MARKDOWN, INVESTIGATION_NOTES_TOGGLE, @@ -174,9 +175,13 @@ describe('Custom detection rules creation', () => { cy.get(ABOUT_DETAILS).within(() => { getDetails(SEVERITY_DETAILS).should('have.text', newRule.severity); getDetails(RISK_SCORE_DETAILS).should('have.text', newRule.riskScore); - getDetails(REFERENCE_URLS_DETAILS).should('have.text', expectedUrls); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should('have.text', expectedMitre); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); getDetails(TAGS_DETAILS).should('have.text', expectedTags); }); cy.get(INVESTIGATION_NOTES_TOGGLE).click({ force: true }); diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts index 3d4aaca8bb78f..22d2a144932bf 100644 --- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_eql.spec.ts @@ -32,6 +32,7 @@ import { DEFINITION_DETAILS, FALSE_POSITIVES_DETAILS, getDetails, + removeExternalLinkText, INDEX_PATTERNS_DETAILS, INVESTIGATION_NOTES_MARKDOWN, INVESTIGATION_NOTES_TOGGLE, @@ -136,9 +137,13 @@ describe('Detection rules, EQL', () => { cy.get(ABOUT_DETAILS).within(() => { getDetails(SEVERITY_DETAILS).should('have.text', eqlRule.severity); getDetails(RISK_SCORE_DETAILS).should('have.text', eqlRule.riskScore); - getDetails(REFERENCE_URLS_DETAILS).should('have.text', expectedUrls); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should('have.text', expectedMitre); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); getDetails(TAGS_DETAILS).should('have.text', expectedTags); }); cy.get(INVESTIGATION_NOTES_TOGGLE).click({ force: true }); diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts index 153c55fae59fe..061b66faca054 100644 --- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_ml.spec.ts @@ -23,6 +23,7 @@ import { DEFINITION_DETAILS, FALSE_POSITIVES_DETAILS, getDetails, + removeExternalLinkText, MACHINE_LEARNING_JOB_ID, MACHINE_LEARNING_JOB_STATUS, MITRE_ATTACK_DETAILS, @@ -122,9 +123,13 @@ describe('Detection rules, machine learning', () => { cy.get(ABOUT_DETAILS).within(() => { getDetails(SEVERITY_DETAILS).should('have.text', machineLearningRule.severity); getDetails(RISK_SCORE_DETAILS).should('have.text', machineLearningRule.riskScore); - getDetails(REFERENCE_URLS_DETAILS).should('have.text', expectedUrls); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should('have.text', expectedMitre); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); getDetails(TAGS_DETAILS).should('have.text', expectedTags); }); cy.get(DEFINITION_DETAILS).within(() => { diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts index e905365d1bbb3..b1ccca5e4f13c 100644 --- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_override.spec.ts @@ -34,6 +34,7 @@ import { DETAILS_TITLE, FALSE_POSITIVES_DETAILS, getDetails, + removeExternalLinkText, INDEX_PATTERNS_DETAILS, INVESTIGATION_NOTES_MARKDOWN, INVESTIGATION_NOTES_TOGGLE, @@ -141,9 +142,13 @@ describe('Detection rules, override', () => { `${newOverrideRule.riskOverride}signal.rule.risk_score` ); getDetails(RULE_NAME_OVERRIDE_DETAILS).should('have.text', newOverrideRule.nameOverride); - getDetails(REFERENCE_URLS_DETAILS).should('have.text', expectedUrls); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should('have.text', expectedMitre); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); getDetails(TAGS_DETAILS).should('have.text', expectedTags); getDetails(TIMESTAMP_OVERRIDE_DETAILS).should('have.text', newOverrideRule.timestampOverride); cy.contains(DETAILS_TITLE, 'Severity override') diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts index a9b43d82bb7fd..c3e7892d63279 100644 --- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_threshold.spec.ts @@ -32,6 +32,7 @@ import { FALSE_POSITIVES_DETAILS, DEFINITION_DETAILS, getDetails, + removeExternalLinkText, INDEX_PATTERNS_DETAILS, INVESTIGATION_NOTES_MARKDOWN, INVESTIGATION_NOTES_TOGGLE, @@ -135,9 +136,13 @@ describe('Detection rules, threshold', () => { cy.get(ABOUT_DETAILS).within(() => { getDetails(SEVERITY_DETAILS).should('have.text', newThresholdRule.severity); getDetails(RISK_SCORE_DETAILS).should('have.text', newThresholdRule.riskScore); - getDetails(REFERENCE_URLS_DETAILS).should('have.text', expectedUrls); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should('have.text', expectedMitre); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); getDetails(TAGS_DETAILS).should('have.text', expectedTags); }); cy.get(INVESTIGATION_NOTES_TOGGLE).click({ force: true }); diff --git a/x-pack/plugins/security_solution/cypress/screens/rule_details.ts b/x-pack/plugins/security_solution/cypress/screens/rule_details.ts index d72210dd3e083..8cf0dfb5f6661 100644 --- a/x-pack/plugins/security_solution/cypress/screens/rule_details.ts +++ b/x-pack/plugins/security_solution/cypress/screens/rule_details.ts @@ -75,3 +75,6 @@ export const TIMESTAMP_OVERRIDE_DETAILS = 'Timestamp override'; export const getDetails = (title: string) => cy.get(DETAILS_TITLE).contains(title).next(DETAILS_DESCRIPTION); + +export const removeExternalLinkText = (str: string) => + str.replace(/\(opens in a new tab or window\)/g, ''); diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx index 2ae5b1d20c3c3..ed7ec77b4f39b 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx @@ -6,6 +6,7 @@ import { mount, shallow, ShallowWrapper } from 'enzyme'; import React from 'react'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { mountWithIntl } from '@kbn/test/jest'; import { encodeIpv6 } from '../../lib/helpers'; @@ -92,7 +93,7 @@ describe('Custom Links', () => { const wrapper = mountWithIntl( {'Example Link'} ); - expect(wrapper.text()).toEqual('Example Link'); + expect(removeExternalLinkText(wrapper.text())).toEqual('Example Link'); }); test('it renders props passed in as link', () => { @@ -448,7 +449,7 @@ describe('Custom Links', () => { describe('WhoisLink', () => { test('it renders ip passed in as domain', () => { const wrapper = mountWithIntl({'Example Link'}); - expect(wrapper.text()).toEqual('Example Link'); + expect(removeExternalLinkText(wrapper.text())).toEqual('Example Link'); }); test('it renders correct href', () => { @@ -473,7 +474,7 @@ describe('Custom Links', () => { {'Example Link'} ); - expect(wrapper.text()).toEqual('Example Link'); + expect(removeExternalLinkText(wrapper.text())).toEqual('Example Link'); }); test('it renders correct href', () => { @@ -504,7 +505,7 @@ describe('Custom Links', () => { const wrapper = mountWithIntl( {'Example Link'} ); - expect(wrapper.text()).toEqual('Example Link'); + expect(removeExternalLinkText(wrapper.text())).toEqual('Example Link'); }); test('it renders correct href', () => { @@ -533,7 +534,7 @@ describe('Custom Links', () => { const wrapper = mountWithIntl( {'Example Link'} ); - expect(wrapper.text()).toEqual('Example Link'); + expect(removeExternalLinkText(wrapper.text())).toEqual('Example Link'); }); test('it renders correct href when port is a number', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx b/x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx index e6a38863d7e5f..8bb652816a975 100644 --- a/x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx @@ -7,6 +7,7 @@ import React from 'react'; import { mount } from 'enzyme'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { MarkdownRenderer } from './renderer'; describe('Markdown', () => { @@ -16,9 +17,9 @@ describe('Markdown', () => { test('it renders the expected link text', () => { const wrapper = mount({markdownWithLink}); - expect(wrapper.find('[data-test-subj="markdown-link"]').first().text()).toEqual( - 'External Site' - ); + expect( + removeExternalLinkText(wrapper.find('[data-test-subj="markdown-link"]').first().text()) + ).toEqual('External Site'); }); test('it renders the expected href', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/paginated_table/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/paginated_table/__snapshots__/index.test.tsx.snap index 6331a2e02b219..6d114258224d1 100644 --- a/x-pack/plugins/security_solution/public/common/components/paginated_table/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/paginated_table/__snapshots__/index.test.tsx.snap @@ -39,6 +39,7 @@ exports[`Paginated Table Component rendering it renders the default load more ta "euiBorderColor": "#343741", "euiBorderEditable": "2px dotted #343741", "euiBorderRadius": "4px", + "euiBorderRadiusSmall": "2px", "euiBorderThick": "2px solid #343741", "euiBorderThin": "1px solid #343741", "euiBorderWidthThick": "2px", @@ -375,6 +376,15 @@ exports[`Paginated Table Component rendering it renders the default load more ta }, }, "euiPaletteColorBlindKeys": "'euiColorVis0', 'euiColorVis1', 'euiColorVis2', 'euiColorVis3', 'euiColorVis4', 'euiColorVis5', 'euiColorVis6', 'euiColorVis7', 'euiColorVis8', 'euiColorVis9'", + "euiPanelBackgroundColorModifiers": Object { + "plain": "#1d1e24", + "subdued": "#25262e", + "transparent": "rgba(0, 0, 0, 0)", + }, + "euiPanelBorderRadiusModifiers": Object { + "borderRadiusMedium": "4px", + "borderRadiusNone": 0, + }, "euiPanelPaddingModifiers": Object { "paddingLarge": "24px", "paddingMedium": "16px", diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap index 6d45059099f8d..71b103949a80a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap @@ -121,7 +121,7 @@ exports[`TrustedAppsGrid renders correctly when loaded data 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" >
{ ); - expect(wrapper.find('[data-test-subj="port"]').first().text()).toEqual('443'); + expect(removeExternalLinkText(wrapper.find('[data-test-subj="port"]').first().text())).toEqual( + '443' + ); }); test('it hyperlinks links destination.port to an external service that describes the purpose of the port', () => { diff --git a/x-pack/plugins/security_solution/public/network/components/source_destination/index.test.tsx b/x-pack/plugins/security_solution/public/network/components/source_destination/index.test.tsx index 2ba5cd868c2b8..2b0231999e6ee 100644 --- a/x-pack/plugins/security_solution/public/network/components/source_destination/index.test.tsx +++ b/x-pack/plugins/security_solution/public/network/components/source_destination/index.test.tsx @@ -9,6 +9,7 @@ import { shallow } from 'enzyme'; import { get } from 'lodash/fp'; import React from 'react'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { asArrayIfExists } from '../../../common/lib/helpers'; import { getMockNetflowData } from '../../../common/mock'; import '../../../common/mock/match_media'; @@ -189,9 +190,11 @@ describe('SourceDestination', () => { test('it renders the destination ip and port, separated with a colon', () => { const wrapper = mount({getSourceDestinationInstance()}); - expect(wrapper.find('[data-test-subj="destination-ip-and-port"]').first().text()).toEqual( - '10.1.2.3:80' - ); + expect( + removeExternalLinkText( + wrapper.find('[data-test-subj="destination-ip-and-port"]').first().text() + ) + ).toEqual('10.1.2.3:80'); }); test('it renders destination.packets', () => { @@ -313,9 +316,9 @@ describe('SourceDestination', () => { test('it renders the source ip and port, separated with a colon', () => { const wrapper = mount({getSourceDestinationInstance()}); - expect(wrapper.find('[data-test-subj="source-ip-and-port"]').first().text()).toEqual( - '192.168.1.2:9987' - ); + expect( + removeExternalLinkText(wrapper.find('[data-test-subj="source-ip-and-port"]').first().text()) + ).toEqual('192.168.1.2:9987'); }); test('it renders source.packets', () => { diff --git a/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_ip.test.tsx b/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_ip.test.tsx index 890add4222503..78f71a84d0b19 100644 --- a/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_ip.test.tsx +++ b/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_ip.test.tsx @@ -7,6 +7,7 @@ import { get } from 'lodash/fp'; import React from 'react'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { asArrayIfExists } from '../../../common/lib/helpers'; import { getMockNetflowData } from '../../../common/mock'; import '../../../common/mock/match_media'; @@ -976,9 +977,11 @@ describe('SourceDestinationIp', () => { ); - expect(wrapper.find('[data-test-subj="draggable-content-source.port"]').first().text()).toEqual( - '9987' - ); + expect( + removeExternalLinkText( + wrapper.find('[data-test-subj="draggable-content-source.port"]').first().text() + ) + ).toEqual('9987'); }); test('it renders the expected destination port when type is `destination`, and both destinationIp and destinationPort are populated', () => { @@ -1028,7 +1031,9 @@ describe('SourceDestinationIp', () => { ); expect( - wrapper.find('[data-test-subj="draggable-content-destination.port"]').first().text() + removeExternalLinkText( + wrapper.find('[data-test-subj="draggable-content-destination.port"]').first().text() + ) ).toEqual('80'); }); @@ -1078,9 +1083,11 @@ describe('SourceDestinationIp', () => { ); - expect(wrapper.find('[data-test-subj="draggable-content-source.port"]').first().text()).toEqual( - '9987' - ); + expect( + removeExternalLinkText( + wrapper.find('[data-test-subj="draggable-content-source.port"]').first().text() + ) + ).toEqual('9987'); }); test('it renders the expected destination port when type is `destination`, and only destinationPort is populated', () => { @@ -1131,7 +1138,9 @@ describe('SourceDestinationIp', () => { ); expect( - wrapper.find('[data-test-subj="draggable-content-destination.port"]').first().text() + removeExternalLinkText( + wrapper.find('[data-test-subj="draggable-content-destination.port"]').first().text() + ) ).toEqual('80'); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx index b31094b07a829..ef515751b6345 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx @@ -6,6 +6,7 @@ import React from 'react'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { TestProviders } from '../../../common/mock'; import '../../../common/mock/match_media'; import { useMountAppended } from '../../../common/utils/use_mount_appended'; @@ -43,9 +44,11 @@ describe('CertificateFingerprint', () => { /> ); - expect(wrapper.find('[data-test-subj="certificate-fingerprint-link"]').first().text()).toEqual( - '3f4c57934e089f02ae7511200aee2d7e7aabd272' - ); + expect( + removeExternalLinkText( + wrapper.find('[data-test-subj="certificate-fingerprint-link"]').first().text() + ) + ).toEqual('3f4c57934e089f02ae7511200aee2d7e7aabd272'); }); test('it renders a hyperlink to an external site to compare the fingerprint against a known set of signatures', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx index 899a6d7486f94..c57546d5cd9aa 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx @@ -6,6 +6,7 @@ import React from 'react'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { TestProviders } from '../../../common/mock'; import '../../../common/mock/match_media'; import { useMountAppended } from '../../../common/utils/use_mount_appended'; @@ -42,9 +43,9 @@ describe('Ja3Fingerprint', () => { ); - expect(wrapper.find('[data-test-subj="ja3-fingerprint-link"]').first().text()).toEqual( - 'fff799d91b7c01ae3fe6787cfc895552' - ); + expect( + removeExternalLinkText(wrapper.find('[data-test-subj="ja3-fingerprint-link"]').first().text()) + ).toEqual('fff799d91b7c01ae3fe6787cfc895552'); }); test('it renders a hyperlink to an external site to compare the fingerprint against a known set of signatures', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/netflow/index.test.tsx index c2026a71ac6ff..9aa462ee23a8b 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/netflow/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/netflow/index.test.tsx @@ -8,6 +8,7 @@ import { get } from 'lodash/fp'; import React from 'react'; import { shallow } from 'enzyme'; +import { removeExternalLinkText } from '../../../../common/test_utils'; import { asArrayIfExists } from '../../../common/lib/helpers'; import { getMockNetflowData } from '../../../common/mock'; import '../../../common/mock/match_media'; @@ -188,9 +189,11 @@ describe('Netflow', () => { test('it renders the destination ip and port, separated with a colon', () => { const wrapper = mount({getNetflowInstance()}); - expect(wrapper.find('[data-test-subj="destination-ip-and-port"]').first().text()).toEqual( - '10.1.2.3:80' - ); + expect( + removeExternalLinkText( + wrapper.find('[data-test-subj="destination-ip-and-port"]').first().text() + ) + ).toEqual('10.1.2.3:80'); }); test('it renders destination.packets', () => { @@ -324,9 +327,9 @@ describe('Netflow', () => { test('it renders the source ip and port, separated with a colon', () => { const wrapper = mount({getNetflowInstance()}); - expect(wrapper.find('[data-test-subj="source-ip-and-port"]').first().text()).toEqual( - '192.168.1.2:9987' - ); + expect( + removeExternalLinkText(wrapper.find('[data-test-subj="source-ip-and-port"]').first().text()) + ).toEqual('192.168.1.2:9987'); }); test('it renders source.packets', () => { @@ -353,11 +356,13 @@ describe('Netflow', () => { const wrapper = mount({getNetflowInstance()}); expect( - wrapper - .find('[data-test-subj="client-certificate-fingerprint"]') - .find('[data-test-subj="certificate-fingerprint-link"]') - .first() - .text() + removeExternalLinkText( + wrapper + .find('[data-test-subj="client-certificate-fingerprint"]') + .find('[data-test-subj="certificate-fingerprint-link"]') + .first() + .text() + ) ).toEqual('tls.client_certificate.fingerprint.sha1-value'); }); @@ -372,9 +377,9 @@ describe('Netflow', () => { test('renders tls.fingerprints.ja3.hash text', () => { const wrapper = mount({getNetflowInstance()}); - expect(wrapper.find('[data-test-subj="ja3-fingerprint-link"]').first().text()).toEqual( - 'tls.fingerprints.ja3.hash-value' - ); + expect( + removeExternalLinkText(wrapper.find('[data-test-subj="ja3-fingerprint-link"]').first().text()) + ).toEqual('tls.fingerprints.ja3.hash-value'); }); test('it hyperlinks tls.server_certificate.fingerprint.sha1 site to compare the fingerprint against a known set of signatures', () => { @@ -395,11 +400,13 @@ describe('Netflow', () => { const wrapper = mount({getNetflowInstance()}); expect( - wrapper - .find('[data-test-subj="server-certificate-fingerprint"]') - .find('[data-test-subj="certificate-fingerprint-link"]') - .first() - .text() + removeExternalLinkText( + wrapper + .find('[data-test-subj="server-certificate-fingerprint"]') + .find('[data-test-subj="certificate-fingerprint-link"]') + .first() + .text() + ) ).toEqual('tls.server_certificate.fingerprint.sha1-value'); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap index 17c614bd2c83c..03dc2afc625cd 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/notes/note_card/__snapshots__/note_card_body.test.tsx.snap @@ -39,6 +39,7 @@ exports[`NoteCardBody renders correctly against snapshot 1`] = ` "euiBorderColor": "#343741", "euiBorderEditable": "2px dotted #343741", "euiBorderRadius": "4px", + "euiBorderRadiusSmall": "2px", "euiBorderThick": "2px solid #343741", "euiBorderThin": "1px solid #343741", "euiBorderWidthThick": "2px", @@ -375,6 +376,15 @@ exports[`NoteCardBody renders correctly against snapshot 1`] = ` }, }, "euiPaletteColorBlindKeys": "'euiColorVis0', 'euiColorVis1', 'euiColorVis2', 'euiColorVis3', 'euiColorVis4', 'euiColorVis5', 'euiColorVis6', 'euiColorVis7', 'euiColorVis8', 'euiColorVis9'", + "euiPanelBackgroundColorModifiers": Object { + "plain": "#1d1e24", + "subdued": "#25262e", + "transparent": "rgba(0, 0, 0, 0)", + }, + "euiPanelBorderRadiusModifiers": Object { + "borderRadiusMedium": "4px", + "borderRadiusNone": 0, + }, "euiPanelPaddingModifiers": Object { "paddingLarge": "24px", "paddingMedium": "16px", diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx index 52b9b9a31fc99..bb61821d31315 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx @@ -8,6 +8,7 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash'; import React from 'react'; +import { removeExternalLinkText } from '../../../../../../common/test_utils'; import '../../../../../common/mock/match_media'; import { mockBrowserFields } from '../../../../../common/containers/source/mock'; import { Ecs } from '../../../../../../common/ecs'; @@ -75,7 +76,7 @@ describe('get_column_renderer', () => { {row} ); - expect(wrapper.text()).toContain( + expect(removeExternalLinkText(wrapper.text())).toContain( '4ETEXPLOITNETGEARWNR2000v5 hidden_lang_avi Stack Overflow (CVE-2016-10174)Source192.168.0.3:53Destination192.168.0.3:6343' ); }); @@ -93,7 +94,7 @@ describe('get_column_renderer', () => { {row} ); - expect(wrapper.text()).toContain( + expect(removeExternalLinkText(wrapper.text())).toContain( '4ETEXPLOITNETGEARWNR2000v5 hidden_lang_avi Stack Overflow (CVE-2016-10174)Source192.168.0.3:53Destination192.168.0.3:6343' ); }); @@ -111,7 +112,7 @@ describe('get_column_renderer', () => { {row} ); - expect(wrapper.text()).toContain( + expect(removeExternalLinkText(wrapper.text())).toContain( 'C8DRTq362Fios6hw16connectionREJSrConnection attempt rejectedtcpSource185.176.26.101:44059Destination207.154.238.205:11568' ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx index 3b9752224e2c1..7ef034994ce5d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx @@ -7,6 +7,7 @@ import { shallow } from 'enzyme'; import React from 'react'; +import { removeExternalLinkText } from '../../../../../../../common/test_utils'; import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; import { mockTimelineData } from '../../../../../../common/mock'; import '../../../../../../common/mock/match_media'; @@ -41,7 +42,7 @@ describe('SuricataDetails', () => { /> ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( '4ETEXPLOITNETGEARWNR2000v5 hidden_lang_avi Stack Overflow (CVE-2016-10174)Source192.168.0.3:53Destination192.168.0.3:6343' ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx index bed2171715380..674f922bf54e6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx @@ -8,6 +8,7 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; +import { removeExternalLinkText } from '../../../../../../../common/test_utils'; import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; import { Ecs } from '../../../../../../../common/ecs'; import { mockTimelineData } from '../../../../../../common/mock'; @@ -58,7 +59,7 @@ describe('suricata_row_renderer', () => { {children} ); - expect(wrapper.text()).toContain( + expect(removeExternalLinkText(wrapper.text())).toContain( '4ETEXPLOITNETGEARWNR2000v5 hidden_lang_avi Stack Overflow (CVE-2016-10174)Source192.168.0.3:53Destination192.168.0.3:6343' ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx index 6c2e9ad7535a1..45381bbc99935 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx @@ -8,6 +8,7 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; +import { removeExternalLinkText } from '../../../../../../../common/test_utils'; import { BrowserFields } from '../../../../../../common/containers/source'; import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; import { Ecs } from '../../../../../../../common/ecs'; @@ -541,7 +542,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'SYSTEM\\NT AUTHORITY@HD-gqf-0af7b4feaccepted a connection viaAmSvc.exe(1084)tcp1:network-community_idSource127.0.0.1:49306Destination127.0.0.1:49305' ); }); @@ -569,7 +570,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'SYSTEM\\NT AUTHORITY@HD-55b-3ec87f66accepted a connection via(4)tcp1:network-community_idSource::1:51324Destination::1:5357' ); }); @@ -597,7 +598,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'Arun\\Anvi-Acer@HD-obe-8bf77f54disconnected viachrome.exe(11620)8.1KBtcp1:LxYHJJv98b2O0fNccXu6HheXmwk=Source192.168.0.6:59356(25.78%)2.1KB(74.22%)6KBDestination10.156.162.53:443' ); }); @@ -625,7 +626,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'SYSTEM\\NT AUTHORITY@HD-55b-3ec87f66disconnected via(4)7.9KBtcp1:ZylzQhsB1dcptA2t4DY8S6l9o8E=Source::1:51338(96.92%)7.7KB(3.08%)249BDestination::1:2869' ); }); @@ -653,7 +654,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'root@foohostopened a socket withgoogle_accounts(2166)Outbound socket (10.4.20.1:59554 -> 10.1.2.3:80) Ooutboundtcp1:network-community_idSource10.4.20.1:59554Destination10.1.2.3:80' ); }); @@ -681,7 +682,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'root@foohostclosed a socket withgoogle_accounts(2166)Outbound socket (10.4.20.1:59508 -> 10.1.2.3:80) Coutboundtcp1:network-community_idSource10.4.20.1:59508Destination10.1.2.3:80' ); }); @@ -875,7 +876,7 @@ describe('GenericRowRenderer', () => { ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'iot.example.comasked forlookup.example.comwith question typeA, which resolved to10.1.2.3(response code:NOERROR)viaan unknown process6.937500msOct 8, 2019 @ 10:05:23.241Oct 8, 2019 @ 10:05:23.248outbounddns177Budp1:network-community_idSource10.9.9.9:58732(22.60%)40B(77.40%)137BDestination10.1.1.1:53OceaniaAustralia🇦🇺AU' ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx index 434be7b23aeee..b980f723b5c0c 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx @@ -6,6 +6,7 @@ import React from 'react'; +import { removeExternalLinkText } from '../../../../../../../common/test_utils'; import '../../../../../../common/mock/match_media'; import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; import { mockTimelineData, TestProviders } from '../../../../../../common/mock'; @@ -41,7 +42,7 @@ describe('ZeekDetails', () => { /> ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'C8DRTq362Fios6hw16connectionREJSrConnection attempt rejectedtcpSource185.176.26.101:44059Destination207.154.238.205:11568' ); }); @@ -56,7 +57,7 @@ describe('ZeekDetails', () => { /> ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'CyIrMA1L1JtLqdIuoldnsudpSource206.189.35.240:57475Destination67.207.67.3:53' ); }); @@ -71,7 +72,7 @@ describe('ZeekDetails', () => { /> ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'CZLkpC22NquQJOpkwehttp302Source206.189.35.240:36220Destination192.241.164.26:80' ); }); @@ -86,7 +87,7 @@ describe('ZeekDetails', () => { /> ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'noticeDropped:falseScan::Port_Scan8.42.77.171 scanned at least 15 unique ports of host 207.154.238.205 in 0m0sSource8.42.77.171' ); }); @@ -101,7 +102,7 @@ describe('ZeekDetails', () => { /> ); - expect(wrapper.text()).toEqual( + expect(removeExternalLinkText(wrapper.text())).toEqual( 'CmTxzt2OVXZLkGDaResslTLSv12TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256Source188.166.66.184:34514Destination91.189.95.15:443' ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx index 9c08fbacafcdc..043bde1c10698 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx @@ -8,6 +8,7 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; +import { removeExternalLinkText } from '../../../../../../../common/test_utils'; import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; import { Ecs } from '../../../../../../../common/ecs'; import { mockTimelineData, TestProviders } from '../../../../../../common/mock'; @@ -57,7 +58,7 @@ describe('zeek_row_renderer', () => { {children} ); - expect(wrapper.text()).toContain( + expect(removeExternalLinkText(wrapper.text())).toContain( 'C8DRTq362Fios6hw16connectionREJSrConnection attempt rejectedtcpSource185.176.26.101:44059Destination207.154.238.205:11568' ); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx index efa22cb2c5617..f148ac5420b06 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx @@ -8,6 +8,7 @@ import { shallow } from 'enzyme'; import { cloneDeep } from 'lodash/fp'; import React from 'react'; +import { removeExternalLinkText } from '../../../../../../../common/test_utils'; import '../../../../../../common/mock/match_media'; import { Ecs } from '../../../../../../../common/ecs'; import { mockTimelineData, TestProviders } from '../../../../../../common/mock'; @@ -89,7 +90,7 @@ describe('ZeekSignature', () => { test('should render value', () => { const wrapper = mount(); - expect(wrapper.text()).toEqual('abc'); + expect(removeExternalLinkText(wrapper.text())).toEqual('abc'); }); test('should render value and link', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.test.tsx index a7de73c9aab29..a51765fc3a720 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.test.tsx @@ -89,10 +89,12 @@ describe('health check', () => { const [description, action] = queryAllByText(/TLS/i); expect(description.textContent).toMatchInlineSnapshot( - `"Alerting relies on API keys, which require TLS between Elasticsearch and Kibana. Learn how to enable TLS."` + `"Alerting relies on API keys, which require TLS between Elasticsearch and Kibana. Learn how to enable TLS.(opens in a new tab or window)"` ); - expect(action.textContent).toMatchInlineSnapshot(`"Learn how to enable TLS."`); + expect(action.textContent).toMatchInlineSnapshot( + `"Learn how to enable TLS.(opens in a new tab or window)"` + ); expect(action.getAttribute('href')).toMatchInlineSnapshot( `"elastic.co/guide/en/kibana/current/configuring-tls.html"` @@ -118,11 +120,11 @@ describe('health check', () => { const description = queryByRole(/banner/i); expect(description!.textContent).toMatchInlineSnapshot( - `"To create an alert, set a value for xpack.encryptedSavedObjects.encryptionKey in your kibana.yml file. Learn how."` + `"To create an alert, set a value for xpack.encryptedSavedObjects.encryptionKey in your kibana.yml file. Learn how.(opens in a new tab or window)"` ); const action = queryByText(/Learn/i); - expect(action!.textContent).toMatchInlineSnapshot(`"Learn how."`); + expect(action!.textContent).toMatchInlineSnapshot(`"Learn how.(opens in a new tab or window)"`); expect(action!.getAttribute('href')).toMatchInlineSnapshot( `"elastic.co/guide/en/kibana/current/alert-action-settings-kb.html#general-alert-action-settings"` ); @@ -148,11 +150,11 @@ describe('health check', () => { const description = queryByText(/Transport Layer Security/i); expect(description!.textContent).toMatchInlineSnapshot( - `"You must enable Transport Layer Security between Kibana and Elasticsearch and configure an encryption key in your kibana.yml file. Learn how"` + `"You must enable Transport Layer Security between Kibana and Elasticsearch and configure an encryption key in your kibana.yml file. Learn how(opens in a new tab or window)"` ); const action = queryByText(/Learn/i); - expect(action!.textContent).toMatchInlineSnapshot(`"Learn how"`); + expect(action!.textContent).toMatchInlineSnapshot(`"Learn how(opens in a new tab or window)"`); expect(action!.getAttribute('href')).toMatchInlineSnapshot( `"elastic.co/guide/en/kibana/current/alerting-getting-started.html#alerting-setup-prerequisites"` ); diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap index 137d11d3f3b09..8ace0445d0eb7 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap @@ -178,6 +178,16 @@ exports[`PingListExpandedRow renders link to docs if body is not recorded but it + + + (opens in a new tab or window) + for more information on recording response bodies.
diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/__test__/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/status_details/__test__/__snapshots__/monitor_status.bar.test.tsx.snap index 69c6bf3fadb1d..7cc96a42411d2 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/__test__/__snapshots__/monitor_status.bar.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/__test__/__snapshots__/monitor_status.bar.test.tsx.snap @@ -55,6 +55,16 @@ Array [ + + + (opens in a new tab or window) +
Date: Tue, 17 Nov 2020 15:31:38 -0700 Subject: [PATCH 2/2] fix bad merge resolution --- .../__stories__/__snapshots__/asset_manager.stories.storyshot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot index b8712b19041ac..70bed1c1679bb 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot @@ -103,7 +103,7 @@ exports[`Storyshots components/Assets/AssetManager no assets 1`] = ` className="euiSpacer euiSpacer--l" />