Skip to content

Commit

Permalink
[Ingest Manager] Fix limited packages incorrect response (#71292)
Browse files Browse the repository at this point in the history
* Fix limited packages incorrect response

* Add test to make sure we don't break this again :D
  • Loading branch information
jen-huang authored Jul 9, 2020
1 parent a32b9e8 commit ab96156
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function getLimitedPackages(options: {
});
})
);
return installedPackagesInfo.filter((pkgInfo) => isPackageLimited).map((pkgInfo) => pkgInfo.name);
return installedPackagesInfo.filter(isPackageLimited).map((pkgInfo) => pkgInfo.name);
}

export async function getPackageSavedObjects(savedObjectsClient: SavedObjectsClientContract) {
Expand Down
16 changes: 16 additions & 0 deletions x-pack/test/ingest_manager_api_integration/apis/epm/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,21 @@ export default function ({ getService }: FtrProviderContext) {
warnAndSkipTest(this, log);
}
});

it('lists all limited packages from the registry', async function () {
if (server.enabled) {
const fetchLimitedPackageList = async () => {
const response = await supertest
.get('/api/ingest_manager/epm/packages/limited')
.set('kbn-xsrf', 'xxx')
.expect(200);
return response.body;
};
const listResponse = await fetchLimitedPackageList();
expect(listResponse.response).to.eql(['endpoint']);
} else {
warnAndSkipTest(this, log);
}
});
});
}

0 comments on commit ab96156

Please sign in to comment.