test: reuse channel status account ids

This commit is contained in:
Peter Steinberger
2026-04-10 22:45:37 +01:00
parent 49ec2f15c3
commit b896f126a2

View File

@@ -169,10 +169,11 @@ function createTelegramCommandTestPlugin(): ChannelPlugin {
return [];
}
const issues: ChannelStatusIssue[] = [];
const issueAccountId = account.accountId ?? DEFAULT_ACCOUNT_ID;
if (account.allowUnmentionedGroups === true) {
issues.push({
channel: "telegram",
accountId: String(account.accountId ?? DEFAULT_ACCOUNT_ID),
accountId: issueAccountId,
kind: "config",
message:
"Config allows unmentioned group messages (requireMention=false). Telegram Bot API privacy mode will block most group messages unless disabled.",
@@ -187,7 +188,7 @@ function createTelegramCommandTestPlugin(): ChannelPlugin {
if (audit?.hasWildcardUnmentionedGroups === true) {
issues.push({
channel: "telegram",
accountId: String(account.accountId ?? DEFAULT_ACCOUNT_ID),
accountId: issueAccountId,
kind: "config",
message:
'Telegram groups config uses "*" with requireMention=false; membership probing is not possible without explicit group IDs.',
@@ -199,7 +200,7 @@ function createTelegramCommandTestPlugin(): ChannelPlugin {
}
issues.push({
channel: "telegram",
accountId: String(account.accountId ?? DEFAULT_ACCOUNT_ID),
accountId: issueAccountId,
kind: "runtime",
message: `Group ${group.chatId} not reachable by bot.${group.status ? ` status=${group.status}` : ""}${group.error ? `: ${group.error}` : ""}`,
});
@@ -240,13 +241,14 @@ function setMinimalChannelsCommandRegistryForTests(): void {
return [];
}
const issues: ChannelStatusIssue[] = [];
const issueAccountId = account.accountId ?? DEFAULT_ACCOUNT_ID;
const messageContent = (
account.application as { intents?: { messageContent?: string } } | undefined
)?.intents?.messageContent;
if (messageContent === "disabled") {
issues.push({
channel: "discord",
accountId: String(account.accountId ?? DEFAULT_ACCOUNT_ID),
accountId: issueAccountId,
kind: "intent",
message:
"Message Content Intent is disabled. Bot may not see normal channel messages.",
@@ -268,7 +270,7 @@ function setMinimalChannelsCommandRegistryForTests(): void {
}
issues.push({
channel: "discord",
accountId: String(account.accountId ?? DEFAULT_ACCOUNT_ID),
accountId: issueAccountId,
kind: "permissions",
message: `Channel ${channel.channelId} permission audit failed.${channel.missing?.length ? ` missing ${channel.missing.join(", ")}` : ""}${channel.error ? `: ${channel.error}` : ""}`,
});