mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* fix endpoint integration * added test Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
This commit is contained in:
parent
b3a3c626c9
commit
d9aed2a8de
2 changed files with 12 additions and 1 deletions
|
@ -172,7 +172,8 @@ export const registerRoutes = (routers: { rbac: FleetRouter; superuser: FleetRou
|
|||
response
|
||||
);
|
||||
if (resp.payload?.item) {
|
||||
return response.ok({ body: { response: resp.payload.item } });
|
||||
// returning item as well here, because pkgVersion is optional in new GET endpoint, and if not specified, the router selects the deprecated route
|
||||
return response.ok({ body: { item: resp.payload.item, response: resp.payload.item } });
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
|
|
@ -102,5 +102,15 @@ export default function (providerContext: FtrProviderContext) {
|
|||
.auth(testUsers.fleet_read_only.username, testUsers.fleet_read_only.password)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('returns package info in item field when calling without version', async function () {
|
||||
// this will install through the registry by default
|
||||
await installPackage(testPkgName, testPkgVersion);
|
||||
const res = await supertest.get(`/api/fleet/epm/packages/${testPkgName}`).expect(200);
|
||||
const packageInfo = res.body.item;
|
||||
// the uploaded version will have this description
|
||||
expect(packageInfo.name).to.equal('apache');
|
||||
await uninstallPackage(testPkgName, testPkgVersion);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue