From cb9d009ea88f78f52792775c25295e03151c9004 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Thu, 11 Feb 2021 12:17:35 +0100 Subject: [PATCH] adjust tests --- .../feature_controls/advanced_settings_security.ts | 2 +- .../apps/api_keys/feature_controls/api_keys_security.ts | 4 ++-- .../apps/discover/feature_controls/discover_security.ts | 6 +++++- .../feature_controls/index_management_security.ts | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts index 4a3dc2b434392..b93e20ffeed6e 100644 --- a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts +++ b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts @@ -148,7 +148,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { kibana: [ { feature: { - discover: ['all'], + discover: ['read'], }, spaces: ['*'], }, diff --git a/x-pack/test/functional/apps/api_keys/feature_controls/api_keys_security.ts b/x-pack/test/functional/apps/api_keys/feature_controls/api_keys_security.ts index c3f3c563840ca..f490accb2a6bd 100644 --- a/x-pack/test/functional/apps/api_keys/feature_controls/api_keys_security.ts +++ b/x-pack/test/functional/apps/api_keys/feature_controls/api_keys_security.ts @@ -60,8 +60,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should render the "Security" section with API Keys', async () => { await PageObjects.common.navigateToApp('management'); const sections = await managementMenu.getSections(); - expect(sections).to.have.length(1); - expect(sections[0]).to.eql({ + expect(sections).to.have.length(2); + expect(sections.find((s) => s.sectionId === 'security')).to.eql({ sectionId: 'security', sectionLinks: ['users', 'roles', 'api_keys', 'role_mappings'], }); diff --git a/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts b/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts index ca314cecbea98..d595dc98a9a1a 100644 --- a/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts +++ b/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts @@ -84,7 +84,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows discover navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map((link) => link.text)).to.eql(['Overview', 'Discover']); + expect(navLinks.map((link) => link.text)).to.eql([ + 'Overview', + 'Discover', + 'Stack Management', // because `global_discover_all_role` enables search sessions + ]); }); it('shows save button', async () => { diff --git a/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts b/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts index bebac46ced78c..28b3ee03ea8f7 100644 --- a/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts +++ b/x-pack/test/functional/apps/index_management/feature_controls/index_management_security.ts @@ -60,8 +60,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should render the "Data" section with index management', async () => { await PageObjects.common.navigateToApp('management'); const sections = await managementMenu.getSections(); - expect(sections).to.have.length(1); - expect(sections[0]).to.eql({ + expect(sections).to.have.length(2); + expect(sections.find((s) => s.sectionId === 'data')).to.eql({ sectionId: 'data', sectionLinks: ['index_management', 'transform'], });