From ff601039b05bdf2eb38ff45724a8b105c356c0db Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Mon, 4 Jun 2018 09:11:51 -0400 Subject: [PATCH] [Management] Show internal indices when toggled even if there are no other indices (#19618) * Ensure we only show the empty state component if they have no data indices AND the include system indices is not checked * Add snapshot test for bug find --- .../create_index_pattern_wizard.test.js.snap | 23 +++++++++++++++++++ .../create_index_pattern_wizard.test.js | 19 +++++++++++++++ .../create_index_pattern_wizard.js | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/__snapshots__/create_index_pattern_wizard.test.js.snap b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/__snapshots__/create_index_pattern_wizard.test.js.snap index 53c2056c3ca9..1b40c3cfd6a4 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/__snapshots__/create_index_pattern_wizard.test.js.snap +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/__snapshots__/create_index_pattern_wizard.test.js.snap @@ -59,3 +59,26 @@ exports[`CreateIndexPatternWizard renders time field step when step is set to 2 /> `; + +exports[`CreateIndexPatternWizard shows system indices even if there are no other indices if the include system indices is toggled 1`] = ` +
+
+ +
+`; diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/create_index_pattern_wizard.test.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/create_index_pattern_wizard.test.js index 94b4612a19d9..3963f9826871 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/create_index_pattern_wizard.test.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern_wizard/__tests__/create_index_pattern_wizard.test.js @@ -77,6 +77,25 @@ describe('CreateIndexPatternWizard', () => { expect(component).toMatchSnapshot(); }); + it('shows system indices even if there are no other indices if the include system indices is toggled', async () => { + const component = shallow( + + ); + + component.setState({ + isInitiallyLoadingIndices: false, + isIncludingSystemIndices: true, + allIndices: [{ name: '.kibana ' }] + }); + + await component.update(); + expect(component).toMatchSnapshot(); + }); + it('renders index pattern step when there are indices', async () => { const component = shallow( !name.startsWith('.')); - if (!hasDataIndices) { + if (!hasDataIndices && !isIncludingSystemIndices) { return ; }