fix(calendar): hide cancelled events in list output (#362) (thanks @sharukh010)
This commit is contained in:
parent
061ffbe89d
commit
ba871197cd
@ -17,6 +17,7 @@
|
||||
- Google API: use transport-level response-header timeouts for API clients while keeping token exchanges bounded, so large downloads are not cut short by `http.Client.Timeout`. (#425) — thanks @laihenyi.
|
||||
- Auth: keep Keep-only service-account fallback isolated to Keep commands so other Google services do not accidentally pick it up. (#414) — thanks @jgwesterlund.
|
||||
- Contacts: send the required `copyMask` when deleting "other contacts", avoiding People API 400 errors. (#384) — thanks @rbansal42.
|
||||
- Calendar: hide cancelled/deleted events from `calendar events` list output by explicitly setting `showDeleted=false`. (#362) — thanks @sharukh010.
|
||||
- Gmail: add a fetch delay in `watch serve` so History API reads don't race message indexing. (#397) — thanks @salmonumbrella.
|
||||
- Gmail: allow Workspace-managed send-as aliases with empty verification status in `send` and `drafts create`. (#407) — thanks @salmonumbrella.
|
||||
- Gmail: preserve the selected `--client` during `watch serve` push handling instead of falling back to the default client. (#411) — thanks @chrysb.
|
||||
|
||||
40
internal/cmd/calendar_list_test.go
Normal file
40
internal/cmd/calendar_list_test.go
Normal file
@ -0,0 +1,40 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"google.golang.org/api/calendar/v3"
|
||||
"google.golang.org/api/option"
|
||||
)
|
||||
|
||||
func TestCalendarEventsListCall_HidesCancelledEvents(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if got := r.URL.Query().Get("showDeleted"); got != "false" {
|
||||
t.Fatalf("expected showDeleted=false, got %q", got)
|
||||
}
|
||||
if got := r.URL.Query().Get("singleEvents"); got != "true" {
|
||||
t.Fatalf("expected singleEvents=true, got %q", got)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"items": []any{}})
|
||||
}))
|
||||
defer srv.Close()
|
||||
|
||||
svc, err := calendar.NewService(context.Background(),
|
||||
option.WithHTTPClient(srv.Client()),
|
||||
option.WithEndpoint(srv.URL+"/"),
|
||||
option.WithoutAuthentication(),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("NewService: %v", err)
|
||||
}
|
||||
|
||||
if _, err := calendarEventsListCall(context.Background(), svc, "primary", "2026-01-01T00:00:00Z", "2026-01-02T00:00:00Z", 10, "", "", "", "", "").Do(); err != nil {
|
||||
t.Fatalf("Do: %v", err)
|
||||
}
|
||||
}
|
||||
@ -287,7 +287,7 @@ func parseBraceKeyValue(key, val string, expr *braceExpr) error {
|
||||
case "y", "yes", boolTrue, "1":
|
||||
t := true
|
||||
expr.Check = &t
|
||||
case "n", "no", "false", "0":
|
||||
case "n", "no", boolFalse, "0":
|
||||
f := false
|
||||
expr.Check = &f
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user