Files
larksuite__cli/shortcuts/im/with_sender_name_test.go
liangshuo-1 2a1613484a feat: add framework flag aliases and unified IM pagination (#2146)
* feat: add framework flag aliases and unified IM pagination

Introduce declarative exact-name flag aliases at the shortcut framework boundary while keeping semantic compatibility domain-owned. Add a shared, format-aware IM pagination pipeline with consistent flags, metadata, safety bounds, resumable cursors, and request throttling.

* fix: align alias attribution and pagination contracts

* fix: align alias contracts and documentation

* test: remove environment-dependent contact bot e2e

* test: restore contact bot e2e

* docs: reduce IM pagination guidance noise

---------

Co-authored-by: liangshuo-1 <266696938+liangshuo-1@users.noreply.github.com>
2026-08-03 19:20:40 +08:00

27 lines
1.1 KiB
Go

// Copyright (c) 2026 Lark Technologies Pte. Ltd.
// SPDX-License-Identifier: MIT
package im
import (
"strings"
"testing"
)
// TestReadRequestsSendWithSenderName asserts every message-read request opts into
// server-side sender name filling by sending with_sender_name=true. Without this
// the producer never fills sender_name/sender_i18n_names/open_bot_id, so bot names
// never appear (AC1/AC5). Covers chat-messages-list, threads-messages-list, and the
// shared mget URL used by messages-mget and messages-search.
func TestReadRequestsSendWithSenderName(t *testing.T) {
if got := buildChatMessageListParams("desc", 50, "oc_x")["with_sender_name"]; len(got) != 1 || got[0] != "true" {
t.Fatalf("chat-messages-list with_sender_name = %#v, want [true]", got)
}
if got := buildThreadsMessagesListParams("desc", "t_x", 50, "")["with_sender_name"]; len(got) != 1 || got[0] != "true" {
t.Fatalf("threads-messages-list with_sender_name = %#v, want [true]", got)
}
if u := buildMGetURL([]string{"om_1"}); !strings.Contains(u, "with_sender_name=true") {
t.Fatalf("buildMGetURL = %q, want to contain with_sender_name=true", u)
}
}