Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const features = [
{ id: 'feature2', category: { id: 'enterpriseSearch' } },
{ id: 'feature3', category: { id: 'securitySolution' } },
{ id: 'feature4', category: { id: 'should_not_be_returned' } }, // not a solution, it should never appeared in the disabled features
{ id: 'feature6', category: { id: 'observability' }, deprecated: true },
] as KibanaFeature[];

describe('#withSpaceSolutionDisabledFeatures', () => {
Expand Down Expand Up @@ -85,5 +86,18 @@ describe('#withSpaceSolutionDisabledFeatures', () => {

expect(result).toEqual(['feature1']); // "baz" from the spaceDisabledFeatures should not be removed
});

test('it does not include deprecated features in space disabled features', () => {
const spaceDisabledFeatures: string[] = [];
const spaceSolution = 'security';

const result = withSpaceSolutionDisabledFeatures(
features,
spaceDisabledFeatures,
spaceSolution
);

expect(result).not.toContain('feature6');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const getFeatureIdsForCategories = (
) => {
return features
.filter((feature) =>
feature.category
// We need to make sure we only reference non-deprecated features
feature.category && !feature.deprecated
? categories.includes(
feature.category.id as 'observability' | 'enterpriseSearch' | 'securitySolution'
)
Expand Down
2 changes: 0 additions & 2 deletions x-pack/test/spaces_api_integration/common/suites/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ export function createTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
'infrastructure',
'inventory',
'logs',
'observabilityCases',
'observabilityCasesV2',
'securitySolutionAssistant',
'securitySolutionAttackDiscovery',
'securitySolutionCases',
'securitySolutionCasesV2',
'siem',
'slo',
Expand Down
2 changes: 0 additions & 2 deletions x-pack/test/spaces_api_integration/common/suites/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ export function getTestSuiteFactory(esArchiver: any, supertest: SuperAgent<any>)
'infrastructure',
'inventory',
'logs',
'observabilityCases',
'observabilityCasesV2',
'securitySolutionAssistant',
'securitySolutionAttackDiscovery',
'securitySolutionCases',
'securitySolutionCasesV2',
'siem',
'slo',
Expand Down
2 changes: 0 additions & 2 deletions x-pack/test/spaces_api_integration/common/suites/get_all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ const ALL_SPACE_RESULTS: Space[] = [
'infrastructure',
'inventory',
'logs',
'observabilityCases',
'observabilityCasesV2',
'securitySolutionAssistant',
'securitySolutionAttackDiscovery',
'securitySolutionCases',
'securitySolutionCasesV2',
'siem',
'slo',
Expand Down