Skip to content

Commit

Permalink
Update to account for access/feature control test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jul 7, 2020
1 parent 52e100d commit 5cae7a1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/enterprise_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export class EnterpriseSearchPlugin implements Plugin {
order: 0,
icon: 'logoEnterpriseSearch',
navLinkId: 'app_search', // TODO - remove this once functional tests no longer rely on navLinkId
app: ['kibana', 'app_search'], // TODO: 'enterprise_search', 'workplace_search'
catalogue: ['app_search'], // TODO: 'enterprise_search', 'workplace_search'
app: ['kibana', 'app_search', 'workplace_search'], // TODO: 'enterprise_search'
catalogue: ['app_search', 'workplace_search'], // TODO: 'enterprise_search'
privileges: null,
});

Expand Down
3 changes: 3 additions & 0 deletions x-pack/test/ui_capabilities/common/nav_links_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export class NavLinksBuilder {
app_search: {
navLinkId: 'app_search',
},
workplace_search: {
navLinkId: 'workplace_search',
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('catalogue');
// everything except ml and monitoring and enterprise search is enabled
const exceptions = ['ml', 'monitoring', 'app_search', 'workplace_search'];
const expected = mapValues(
uiCapabilities.value!.catalogue,
(enabled, catalogueId) => !['ml', 'monitoring', 'app_search'].includes(catalogueId)
(enabled, catalogueId) => !exceptions.includes(catalogueId)
);
expect(uiCapabilities.value!.catalogue).to.eql(expected);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('navLinks');
expect(uiCapabilities.value!.navLinks).to.eql(
navLinksBuilder.except('ml', 'monitoring', 'enterprise_search', 'app_search')
navLinksBuilder.except(
'ml',
'monitoring',
'enterprise_search',
'app_search',
'workplace_search'
)
);
break;
case 'superuser at nothing_space':
Expand Down
3 changes: 2 additions & 1 deletion x-pack/test/ui_capabilities/security_only/tests/catalogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('catalogue');
// everything except ml and monitoring and enterprise_search is enabled
const exceptions = ['ml', 'monitoring', 'app_search', 'workplace_search'];
const expected = mapValues(
uiCapabilities.value!.catalogue,
(enabled, catalogueId) => !['ml', 'monitoring', 'app_search'].includes(catalogueId)
(enabled, catalogueId) => !exceptions.includes(catalogueId)
);
expect(uiCapabilities.value!.catalogue).to.eql(expected);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('navLinks');
expect(uiCapabilities.value!.navLinks).to.eql(
navLinksBuilder.except('ml', 'monitoring', 'app_search')
navLinksBuilder.except('ml', 'monitoring', 'app_search', 'workplace_search')
);
break;
case 'foo_all':
Expand Down

0 comments on commit 5cae7a1

Please sign in to comment.