mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Also reset engineName and engineNotFound on clearEngine (#87259)
This commit is contained in:
parent
bd91c16036
commit
8c74bb3345
2 changed files with 26 additions and 0 deletions
|
@ -136,6 +136,18 @@ describe('EngineLogic', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('engineName', () => {
|
||||
it('should be reset to an empty string', () => {
|
||||
mount({ engineName: 'hello-world' });
|
||||
EngineLogic.actions.clearEngine();
|
||||
|
||||
expect(EngineLogic.values).toEqual({
|
||||
...DEFAULT_VALUES,
|
||||
engineName: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('dataLoading', () => {
|
||||
it('should be set to true', () => {
|
||||
mount({ dataLoading: false });
|
||||
|
@ -147,6 +159,18 @@ describe('EngineLogic', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('engineNotFound', () => {
|
||||
it('should be set to false', () => {
|
||||
mount({ engineNotFound: true });
|
||||
EngineLogic.actions.clearEngine();
|
||||
|
||||
expect(EngineLogic.values).toEqual({
|
||||
...DEFAULT_VALUES,
|
||||
engineNotFound: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('initializeEngine', () => {
|
||||
|
|
|
@ -64,12 +64,14 @@ export const EngineLogic = kea<MakeLogicType<EngineValues, EngineActions>>({
|
|||
'',
|
||||
{
|
||||
setEngineName: (_, { engineName }) => engineName,
|
||||
clearEngine: () => '',
|
||||
},
|
||||
],
|
||||
engineNotFound: [
|
||||
false,
|
||||
{
|
||||
setEngineNotFound: (_, { notFound }) => notFound,
|
||||
clearEngine: () => false,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue