Skip to content

Commit

Permalink
[INGEST_MANAGER] Make package config name blank for endpoint on Packa…
Browse files Browse the repository at this point in the history
…ge Config create (#73082)

* Make package config name blank for endpoint
* Added functional tests on endpoint side
  • Loading branch information
paul-tavares authored Jul 24, 2020
1 parent 680d94c commit e341eaf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ export const StepDefinePackageConfig: React.FunctionComponent<{
.sort();

updatePackageConfig({
name: `${packageInfo.name}-${
dsWithMatchingNames.length ? dsWithMatchingNames[dsWithMatchingNames.length - 1] + 1 : 1
}`,
name:
// For Endpoint packages, the user must fill in the name, thus we don't attempt to generate
// a default one here.
// FIXME: Improve package configs name uniqueness - https://github.com/elastic/kibana/issues/72948
packageInfo.name !== 'endpoint'
? `${packageInfo.name}-${
dsWithMatchingNames.length
? dsWithMatchingNames[dsWithMatchingNames.length - 1] + 1
: 1
}`
: '',
package: {
name: packageInfo.name,
title: packageInfo.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
expect(endpointConfig).not.to.be(undefined);
});

it('should have empty value for package configuration name', async () => {
await pageObjects.ingestManagerCreatePackageConfig.selectAgentConfig();
expect(await pageObjects.ingestManagerCreatePackageConfig.getPackageConfigName()).to.be('');
});

it('should redirect user back to Policy List after a successful save', async () => {
const newPolicyName = `endpoint policy ${Date.now()}`;
await pageObjects.ingestManagerCreatePackageConfig.selectAgentConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ export function IngestManagerCreatePackageConfig({
}
},

/**
* Returns the package config name currently populated on the input field
*/
async getPackageConfigName() {
return testSubjects.getAttribute('packageConfigNameInput', 'value');
},

/**
* Set the name of the package config on the input field
* @param name
Expand Down

0 comments on commit e341eaf

Please sign in to comment.