-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security solution] A/B Testing for Guided Onboarding content #163739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
stephmilovic
merged 17 commits into
elastic:main
from
stephmilovic:ab_testing_onboarding
Sep 13, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3060dd0
initial
stephmilovic 453b3d9
Merge branch 'main' into ab_testing_onboarding
stephmilovic b8c3f4f
rm logs, it works!
stephmilovic 817af1e
add tests
stephmilovic b079796
Merge branch 'main' into ab_testing_onboarding
stephmilovic 5b05a9a
only run experiment when language is english
stephmilovic c3828b2
Merge branch 'main' into ab_testing_onboarding
kibanamachine 7d0887e
Merge branch 'main' into ab_testing_onboarding
kibanamachine e80f205
Merge branch 'main' into ab_testing_onboarding
kibanamachine 17907a0
Merge branch 'main' into ab_testing_onboarding
stephmilovic eac2caa
add definition comment
stephmilovic dc62c40
Merge branch 'main' into ab_testing_onboarding
kibanamachine d26b24a
fix merge
stephmilovic 5bfb7f1
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 0833071
Merge branch 'main' into ab_testing_onboarding
angorayc f63e351
Merge branch 'main' into ab_testing_onboarding
kibanamachine a4a86fd
Merge branch 'main' into ab_testing_onboarding
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
230 changes: 230 additions & 0 deletions
230
x-pack/plugins/security_solution/common/guided_onboarding/siem_guide_config.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,230 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { defaultGuideTranslations, getSiemGuideConfig, siemGuideId } from './siem_guide_config'; | ||
| import * as i18n from './translations'; | ||
|
|
||
| describe('getSiemGuideConfig', () => { | ||
| it('returns a GuideConfig object with default values when no arguments are passed', () => { | ||
| const result = getSiemGuideConfig(); | ||
| expect(result).toEqual({ | ||
| title: defaultGuideTranslations.title, | ||
| guideName: 'Security', | ||
| telemetryId: siemGuideId, | ||
| completedGuideRedirectLocation: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/dashboards', | ||
| }, | ||
| description: defaultGuideTranslations.description, | ||
| docs: { | ||
| text: defaultGuideTranslations.docs, | ||
| url: 'https://www.elastic.co/guide/en/security/current/ingest-data.html', | ||
| }, | ||
| steps: [ | ||
| { | ||
| id: 'add_data', | ||
| title: defaultGuideTranslations.steps.add_data.title, | ||
| description: { | ||
| descriptionText: defaultGuideTranslations.steps.add_data.description, | ||
| linkUrl: 'https://docs.elastic.co/en/integrations/endpoint', | ||
| isLinkExternal: true, | ||
| linkText: i18n.LINK_TEXT, | ||
| }, | ||
| integration: 'endpoint', | ||
| location: { | ||
| appID: 'integrations', | ||
| path: '/browse/security', | ||
| }, | ||
| }, | ||
| { | ||
| id: 'rules', | ||
| title: defaultGuideTranslations.steps.rules.title, | ||
| description: defaultGuideTranslations.steps.rules.description, | ||
| location: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/rules', | ||
| }, | ||
| manualCompletion: defaultGuideTranslations.steps.rules.manualCompletion, | ||
| }, | ||
| { | ||
| id: 'alertsCases', | ||
| title: defaultGuideTranslations.steps.alertsCases.title, | ||
| description: defaultGuideTranslations.steps.alertsCases.description, | ||
| location: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/alerts', | ||
| }, | ||
| manualCompletion: defaultGuideTranslations.steps.alertsCases.manualCompletion, | ||
| }, | ||
| ], | ||
| }); | ||
| }); | ||
|
|
||
| it('returns a GuideConfig object with values from the launchDarkly argument when it is passed', () => { | ||
| const launchDarkly = { | ||
| title: 'Custom Title', | ||
| description: 'Custom Description', | ||
| docs: 'Custom Docs', | ||
| steps: { | ||
| add_data: { | ||
| title: 'Custom Add Data Title', | ||
| description: 'Custom Add Data Description', | ||
| }, | ||
| rules: { | ||
| title: 'Custom Rules Title', | ||
| description: 'Custom Rules Description', | ||
| manualCompletion: { | ||
| title: 'Custom Rules Manual Title', | ||
| description: 'Custom Rules Manual Description', | ||
| }, | ||
| }, | ||
| alertsCases: { | ||
| title: 'Custom Alerts Cases Title', | ||
| description: 'Custom Alerts Cases Description', | ||
| manualCompletion: { | ||
| title: 'Custom Alerts Cases Manual Title', | ||
| description: 'Custom Alerts Cases Manual Description', | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
| const result = getSiemGuideConfig(launchDarkly); | ||
| expect(result).toEqual({ | ||
| title: launchDarkly.title, | ||
| guideName: 'Security', | ||
| telemetryId: siemGuideId, | ||
| completedGuideRedirectLocation: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/dashboards', | ||
| }, | ||
| description: launchDarkly.description, | ||
| docs: { | ||
| text: launchDarkly.docs, | ||
| url: 'https://www.elastic.co/guide/en/security/current/ingest-data.html', | ||
| }, | ||
| steps: [ | ||
| { | ||
| id: 'add_data', | ||
| title: launchDarkly.steps.add_data.title, | ||
| description: { | ||
| descriptionText: launchDarkly.steps.add_data.description, | ||
| linkUrl: 'https://docs.elastic.co/en/integrations/endpoint', | ||
| isLinkExternal: true, | ||
| linkText: i18n.LINK_TEXT, | ||
| }, | ||
| integration: 'endpoint', | ||
| location: { | ||
| appID: 'integrations', | ||
| path: '/browse/security', | ||
| }, | ||
| }, | ||
| { | ||
| id: 'rules', | ||
| title: launchDarkly.steps.rules.title, | ||
| description: launchDarkly.steps.rules.description, | ||
| manualCompletion: { | ||
| title: launchDarkly.steps.rules.manualCompletion.title, | ||
| description: launchDarkly.steps.rules.manualCompletion.description, | ||
| }, | ||
| location: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/rules', | ||
| }, | ||
| }, | ||
| { | ||
| id: 'alertsCases', | ||
| title: launchDarkly.steps.alertsCases.title, | ||
| description: launchDarkly.steps.alertsCases.description, | ||
| manualCompletion: { | ||
| title: launchDarkly.steps.alertsCases.manualCompletion.title, | ||
| description: launchDarkly.steps.alertsCases.manualCompletion.description, | ||
| }, | ||
| location: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/alerts', | ||
| }, | ||
| }, | ||
| ], | ||
| }); | ||
| }); | ||
|
|
||
| it('returns a GuideConfig object with values from the launchDarkly argument and default values when some properties are missing', () => { | ||
| const launchDarkly = { | ||
| steps: { | ||
| add_data: { | ||
| title: 'Custom Add Data Title', | ||
| }, | ||
| rules: { | ||
| description: 'Custom Rules Description', | ||
| }, | ||
| alertsCases: { | ||
| manualCompletion: { | ||
| title: 'Custom Alerts Cases Manual Title', | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
| // Ignore because intentionally passing an incomplete object to test that we handle missing properties | ||
| // since there is no validation on the object from LaunchDarkly | ||
| // @ts-ignore | ||
| const result = getSiemGuideConfig(launchDarkly); | ||
| expect(result).toEqual({ | ||
| title: defaultGuideTranslations.title, | ||
| guideName: 'Security', | ||
| telemetryId: siemGuideId, | ||
| completedGuideRedirectLocation: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/dashboards', | ||
| }, | ||
| description: defaultGuideTranslations.description, | ||
| docs: { | ||
| text: defaultGuideTranslations.docs, | ||
| url: 'https://www.elastic.co/guide/en/security/current/ingest-data.html', | ||
| }, | ||
| steps: [ | ||
| { | ||
| id: 'add_data', | ||
| title: launchDarkly.steps.add_data.title, | ||
| description: { | ||
| descriptionText: defaultGuideTranslations.steps.add_data.description, | ||
| linkUrl: 'https://docs.elastic.co/en/integrations/endpoint', | ||
| isLinkExternal: true, | ||
| linkText: i18n.LINK_TEXT, | ||
| }, | ||
| integration: 'endpoint', | ||
| location: { | ||
| appID: 'integrations', | ||
| path: '/browse/security', | ||
| }, | ||
| }, | ||
| { | ||
| id: 'rules', | ||
| title: defaultGuideTranslations.steps.rules.title, | ||
| description: launchDarkly.steps.rules.description, | ||
| location: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/rules', | ||
| }, | ||
| manualCompletion: defaultGuideTranslations.steps.rules.manualCompletion, | ||
| }, | ||
| { | ||
| id: 'alertsCases', | ||
| title: defaultGuideTranslations.steps.alertsCases.title, | ||
| description: defaultGuideTranslations.steps.alertsCases.description, | ||
| manualCompletion: { | ||
| title: launchDarkly.steps.alertsCases.manualCompletion.title, | ||
| description: defaultGuideTranslations.steps.alertsCases.manualCompletion.description, | ||
| }, | ||
| location: { | ||
| appID: 'securitySolutionUI', | ||
| path: '/alerts', | ||
| }, | ||
| }, | ||
| ], | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.