MCPcopy Create free account
hub / github.com/algolia/cli / TestChangeApplicationPlan_EmptyBodyFallback

Function TestChangeApplicationPlan_EmptyBodyFallback

api/dashboard/client_test.go:492–508  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

490}
491
492func TestChangeApplicationPlan_EmptyBodyFallback(t *testing.T) {
493 mux := http.NewServeMux()
494 mux.HandleFunc(
495 "/1/applications/APP1/plan/self-serve",
496 func(w http.ResponseWriter, r *http.Request) {
497 w.WriteHeader(http.StatusNoContent)
498 },
499 )
500
501 ts, client := newTestClient(mux)
502 defer ts.Close()
503
504 // An empty/204 body still yields a usable result with the known app ID.
505 app, err := client.ChangeApplicationPlan("test-token", "APP1", "free")
506 require.NoError(t, err)
507 assert.Equal(t, "APP1", app.ID)
508}
509
510func TestChangeApplicationPlan_Unauthorized(t *testing.T) {
511 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 3

newTestClientFunction · 0.85
ChangeApplicationPlanMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected