Skip to content

Commit

Permalink
Add tests and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed May 11, 2021
1 parent c2670e1 commit 1db74ed
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Support filtering /categories using `kibana.version` query param [#695](https://github.com/elastic/package-registry/pull/695)

### Deprecated

### Known Issues
Expand Down
1 change: 1 addition & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestEndpoints(t *testing.T) {
{"/categories", "/categories", "categories.json", categoriesHandler(packagesBasePaths, testCacheTime)},
{"/categories?experimental=true", "/categories", "categories-experimental.json", categoriesHandler(packagesBasePaths, testCacheTime)},
{"/categories?experimental=foo", "/categories", "categories-experimental-error.json", categoriesHandler(packagesBasePaths, testCacheTime)},
{"/categories?experimental=true&kibana.version=6.5.2", "/categories", "categories-kibana652.json", categoriesHandler(packagesBasePaths, testCacheTime)},
{"/categories?include_policy_templates=true", "/categories", "categories-include-policy-templates.json", categoriesHandler(packagesBasePaths, testCacheTime)},
{"/categories?include_policy_templates=foo", "/categories", "categories-include-policy-templates-error.json", categoriesHandler(packagesBasePaths, testCacheTime)},
{"/search?kibana.version=6.5.2", "/search", "search-kibana652.json", searchHandler(packagesBasePaths, testCacheTime)},
Expand Down
32 changes: 32 additions & 0 deletions testdata/generated/categories-kibana652.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"id": "aws",
"title": "AWS",
"count": 1
},
{
"id": "containers",
"title": "Containers",
"count": 1
},
{
"id": "custom",
"title": "Custom",
"count": 6
},
{
"id": "message_queue",
"title": "Message Queue",
"count": 1
},
{
"id": "monitoring",
"title": "Monitoring",
"count": 1
},
{
"id": "web",
"title": "Web",
"count": 1
}
]

0 comments on commit 1db74ed

Please sign in to comment.