mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
(cherry picked from commit 595a048128
)
Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
This commit is contained in:
parent
9e9e0d6a68
commit
44d60ef9e8
2 changed files with 14 additions and 1 deletions
|
@ -227,6 +227,17 @@ describe('EnginesLogic', () => {
|
|||
expect(EnginesLogic.actions.loadEngines).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call loadEngines if engine.type === elasticsearch', () => {
|
||||
jest.spyOn(EnginesLogic.actions, 'loadEngines');
|
||||
|
||||
EnginesLogic.actions.onDeleteEngineSuccess({
|
||||
...MOCK_ENGINE,
|
||||
type: 'elasticsearch' as EngineTypes.elasticsearch,
|
||||
});
|
||||
|
||||
expect(EnginesLogic.actions.loadEngines).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call loadMetaEngines if engine.type === meta', () => {
|
||||
jest.spyOn(EnginesLogic.actions, 'loadMetaEngines');
|
||||
|
||||
|
|
|
@ -150,7 +150,9 @@ export const EnginesLogic = kea<MakeLogicType<EnginesValues, EnginesActions>>({
|
|||
},
|
||||
onDeleteEngineSuccess: async ({ engine }) => {
|
||||
flashSuccessToast(DELETE_ENGINE_MESSAGE(engine.name));
|
||||
if ([EngineTypes.default, EngineTypes.indexed].includes(engine.type)) {
|
||||
if (
|
||||
[EngineTypes.default, EngineTypes.indexed, EngineTypes.elasticsearch].includes(engine.type)
|
||||
) {
|
||||
actions.loadEngines();
|
||||
} else if (engine.type === EngineTypes.meta) {
|
||||
actions.loadMetaEngines();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue