mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:00:44 +00:00
test: update channel status label fixtures
This commit is contained in:
@@ -31,7 +31,15 @@ type ChannelSectionConfig = {
|
||||
};
|
||||
|
||||
function formatChannelStatusJoined(channelAccounts: Record<string, unknown>) {
|
||||
return formatGatewayChannelsStatusLines({ channelAccounts }).join("\n");
|
||||
return formatGatewayChannelsStatusLines({
|
||||
channelLabels: {
|
||||
discord: "Discord",
|
||||
signal: "Signal",
|
||||
telegram: "Telegram",
|
||||
whatsapp: "WhatsApp",
|
||||
},
|
||||
channelAccounts,
|
||||
}).join("\n");
|
||||
}
|
||||
|
||||
function listConfiguredAccountIds(channelConfig: ChannelSectionConfig | undefined): string[] {
|
||||
@@ -637,6 +645,10 @@ describe("channels command", () => {
|
||||
|
||||
it("formats gateway channel status lines in registry order", () => {
|
||||
const lines = formatGatewayChannelsStatusLines({
|
||||
channelLabels: {
|
||||
telegram: "Telegram",
|
||||
whatsapp: "WhatsApp",
|
||||
},
|
||||
channelAccounts: {
|
||||
telegram: [{ accountId: "default", configured: true }],
|
||||
whatsapp: [{ accountId: "default", linked: true }],
|
||||
@@ -756,6 +768,9 @@ describe("channels command", () => {
|
||||
|
||||
it("surfaces WhatsApp auth/runtime hints when unlinked or disconnected", () => {
|
||||
const unlinked = formatGatewayChannelsStatusLines({
|
||||
channelLabels: {
|
||||
whatsapp: "WhatsApp",
|
||||
},
|
||||
channelAccounts: {
|
||||
whatsapp: [{ accountId: "default", enabled: true, linked: false }],
|
||||
},
|
||||
@@ -764,6 +779,9 @@ describe("channels command", () => {
|
||||
expect(unlinked.join("\n")).toMatch(/Not linked/i);
|
||||
|
||||
const disconnected = formatGatewayChannelsStatusLines({
|
||||
channelLabels: {
|
||||
whatsapp: "WhatsApp",
|
||||
},
|
||||
channelAccounts: {
|
||||
whatsapp: [
|
||||
{
|
||||
|
||||
@@ -33,6 +33,9 @@ describe("channels command", () => {
|
||||
|
||||
it("surfaces Signal runtime errors in channels status output", () => {
|
||||
const lines = formatGatewayChannelsStatusLines({
|
||||
channelLabels: {
|
||||
signal: "Signal",
|
||||
},
|
||||
channelAccounts: {
|
||||
signal: [
|
||||
{
|
||||
@@ -61,6 +64,9 @@ describe("channels command", () => {
|
||||
]),
|
||||
);
|
||||
const lines = formatGatewayChannelsStatusLines({
|
||||
channelLabels: {
|
||||
imessage: "iMessage",
|
||||
},
|
||||
channelAccounts: {
|
||||
imessage: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user