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

Function TestGetUser_DataAttributes

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

Source from the content-addressed store, hash-verified

440}
441
442func TestGetUser_DataAttributes(t *testing.T) {
443 mux := http.NewServeMux()
444 mux.HandleFunc("/1/user", func(w http.ResponseWriter, r *http.Request) {
445 _, err := w.Write(
446 []byte(
447 `{"data":{"attributes":{"has_payment_method": false, "current_plan": "build"}}}`,
448 ),
449 )
450 require.NoError(t, err)
451 })
452
453 ts, client := newTestClient(mux)
454 defer ts.Close()
455
456 user, err := client.GetUser("test-token")
457 require.NoError(t, err)
458 assert.False(t, user.HasPaymentMethod)
459}
460
461func TestChangeApplicationPlan_Success(t *testing.T) {
462 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 3

newTestClientFunction · 0.85
GetUserMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected