package api_test import ( "net/http" "testing" "atlas9.dev/c/core/assert" "atlas9.dev/c/demo/api" ) func TestUsersApi_ListByTenant(t *testing.T) { s := startServer(t) // Name is stored on the user record; the profile endpoint edits it. httpRes := s.call(t, "/Profiles_Save", api.Profiles_SaveReq{Name: "Alice"}, nil) assert.Eq(t, httpRes.StatusCode, http.StatusOK) var list api.Users_ListByTenantRes httpRes = s.call(t, "/Users_ListByTenant", api.Users_ListByTenantReq{ Tenant: defaultTenant, }, &list) assert.Eq(t, httpRes.StatusCode, http.StatusOK) assert.Eq(t, len(list.Page.Items), 1) assert.Eq(t, list.Page.Items[0].Name, "Alice") assert.Eq(t, list.Page.Items[0].Email, "default@test") }