Skip to content

Commit

Permalink
updated JS dependencies (#225)
Browse files Browse the repository at this point in the history
* updated JS dependencies

* fixed tests
  • Loading branch information
prabhatsharma committed Jun 22, 2022
1 parent 6906f07 commit 32758db
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 230 deletions.
4 changes: 2 additions & 2 deletions test/api/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestApiBase(t *testing.T) {
data := make(map[string]interface{})
err := json.Unmarshal(resp.Body.Bytes(), &data)
assert.NoError(t, err)
_, ok := data["Version"]
_, ok := data["version"]
assert.True(t, ok)
})
t.Run("/healthz", func(t *testing.T) {
Expand All @@ -54,7 +54,7 @@ func TestApiBase(t *testing.T) {
data := make(map[string]interface{})
err := json.Unmarshal(resp.Body.Bytes(), &data)
assert.NoError(t, err)
status, ok := data["status"]
status, ok := data["message"]
assert.True(t, ok)
assert.Equal(t, "ok", status)
})
Expand Down
8 changes: 7 additions & 1 deletion test/api/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ func TestIndex(t *testing.T) {
body.WriteString(fmt.Sprintf(`{"name":"%s","storage_type":"disk"}`, "newindex"))
resp := request("PUT", "/api/index", body)
assert.Equal(t, http.StatusOK, resp.Code)
assert.Equal(t, resp.Body.String(), `{"index":"newindex","message":"ok","storage_type":"disk"}`)

data := make(map[string]interface{})
err := json.Unmarshal(resp.Body.Bytes(), &data)
assert.NoError(t, err)
assert.Equal(t, data["index"], "newindex")
assert.Equal(t, data["storage_type"], "disk")
assert.Equal(t, data["message"], "ok")
})

t.Run("create index with error input", func(t *testing.T) {
Expand Down
Loading

0 comments on commit 32758db

Please sign in to comment.