Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gsavit committed Jan 5, 2021
1 parent 19ab7c0 commit a607bc9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,22 @@ func testListEventAuthorizationsHandler(w http.ResponseWriter, r *http.Request)
})
w.Write(response)
}

func TestUninstallApp(t *testing.T) {
http.HandleFunc("/apps.uninstall", testUninstallAppHandler)
once.Do(startServer)

api := New("test-token", OptionAPIURL("http://"+serverAddr+"/"))

err := api.UninstallApp("", "")

if err != nil {
t.Errorf("Failed, but should have succeeded")
}
}

func testUninstallAppHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
response, _ := json.Marshal(SlackResponse{Ok: true})
w.Write(response)
}

0 comments on commit a607bc9

Please sign in to comment.