test: simplify health account id collection

This commit is contained in:
Peter Steinberger
2026-05-08 23:48:33 +01:00
parent 41130a83d1
commit 4be8fd5055

View File

@@ -95,7 +95,12 @@ function getTelegramChannelConfig(cfg: Record<string, unknown>) {
function listTelegramAccountIdsForTest(cfg: Record<string, unknown>): string[] {
const telegram = getTelegramChannelConfig(cfg);
const accounts = telegram.accounts as Record<string, unknown> | undefined;
const ids = Object.keys(accounts ?? {}).filter(Boolean);
const ids: string[] = [];
for (const accountId of Object.keys(accounts ?? {})) {
if (accountId) {
ids.push(accountId);
}
}
return ids.length > 0 ? ids : ["default"];
}