-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/94603
- Loading branch information
Showing
249 changed files
with
7,592 additions
and
2,496 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,31 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { BehaviorSubject } from 'rxjs'; | ||
import { GuidedOnboardingPluginStart } from '.'; | ||
|
||
const apiServiceMock: jest.Mocked<GuidedOnboardingPluginStart> = { | ||
guidedOnboardingApi: { | ||
setup: jest.fn(), | ||
fetchActiveGuideState$: () => new BehaviorSubject(undefined), | ||
fetchAllGuidesState: jest.fn(), | ||
updateGuideState: jest.fn(), | ||
activateGuide: jest.fn(), | ||
completeGuide: jest.fn(), | ||
isGuideStepActive$: () => new BehaviorSubject(false), | ||
startGuideStep: jest.fn(), | ||
completeGuideStep: jest.fn(), | ||
isGuidedOnboardingActiveForIntegration$: () => new BehaviorSubject(false), | ||
completeGuidedOnboardingForIntegration: jest.fn(), | ||
}, | ||
}; | ||
|
||
export const guidedOnboardingMock = { | ||
createSetup: () => {}, | ||
createStart: () => apiServiceMock, | ||
}; |
97 changes: 97 additions & 0 deletions
97
src/plugins/guided_onboarding/public/services/api.mocks.ts
This file contains 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,97 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { GuideState } from '../../common/types'; | ||
|
||
export const searchAddDataActiveState: GuideState = { | ||
guideId: 'search', | ||
isActive: true, | ||
status: 'in_progress', | ||
steps: [ | ||
{ | ||
id: 'add_data', | ||
status: 'active', | ||
}, | ||
{ | ||
id: 'browse_docs', | ||
status: 'inactive', | ||
}, | ||
{ | ||
id: 'search_experience', | ||
status: 'inactive', | ||
}, | ||
], | ||
}; | ||
|
||
export const searchAddDataInProgressState: GuideState = { | ||
isActive: true, | ||
status: 'in_progress', | ||
steps: [ | ||
{ | ||
id: 'add_data', | ||
status: 'in_progress', | ||
}, | ||
{ | ||
id: 'browse_docs', | ||
status: 'inactive', | ||
}, | ||
{ | ||
id: 'search_experience', | ||
status: 'inactive', | ||
}, | ||
], | ||
guideId: 'search', | ||
}; | ||
|
||
export const securityAddDataInProgressState: GuideState = { | ||
guideId: 'security', | ||
status: 'in_progress', | ||
isActive: true, | ||
steps: [ | ||
{ | ||
id: 'add_data', | ||
status: 'in_progress', | ||
}, | ||
{ | ||
id: 'rules', | ||
status: 'inactive', | ||
}, | ||
], | ||
}; | ||
|
||
export const securityRulesActivesState: GuideState = { | ||
guideId: 'security', | ||
isActive: true, | ||
status: 'in_progress', | ||
steps: [ | ||
{ | ||
id: 'add_data', | ||
status: 'complete', | ||
}, | ||
{ | ||
id: 'rules', | ||
status: 'active', | ||
}, | ||
], | ||
}; | ||
|
||
export const noGuideActiveState: GuideState = { | ||
guideId: 'security', | ||
status: 'in_progress', | ||
isActive: false, | ||
steps: [ | ||
{ | ||
id: 'add_data', | ||
status: 'in_progress', | ||
}, | ||
{ | ||
id: 'rules', | ||
status: 'inactive', | ||
}, | ||
], | ||
}; |
Oops, something went wrong.