test: cover gif playback send params
This commit is contained in:
@@ -129,6 +129,30 @@ describe("gateway-cli coverage", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("passes gifPlayback for gateway send when flag set", async () => {
|
||||||
|
runtimeLogs.length = 0;
|
||||||
|
runtimeErrors.length = 0;
|
||||||
|
callGateway.mockClear();
|
||||||
|
randomIdempotencyKey.mockClear();
|
||||||
|
|
||||||
|
const { registerGatewayCli } = await import("./gateway-cli.js");
|
||||||
|
const program = new Command();
|
||||||
|
program.exitOverride();
|
||||||
|
registerGatewayCli(program);
|
||||||
|
|
||||||
|
await program.parseAsync(
|
||||||
|
["gateway", "send", "--to", "+1555", "--message", "hi", "--gif-playback"],
|
||||||
|
{ from: "user" },
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(callGateway).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
method: "send",
|
||||||
|
params: expect.objectContaining({ gifPlayback: true }),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("validates gateway ports and handles force/start errors", async () => {
|
it("validates gateway ports and handles force/start errors", async () => {
|
||||||
runtimeLogs.length = 0;
|
runtimeLogs.length = 0;
|
||||||
runtimeErrors.length = 0;
|
runtimeErrors.length = 0;
|
||||||
|
|||||||
@@ -76,6 +76,27 @@ describe("sendCommand", () => {
|
|||||||
expect(runtime.log).toHaveBeenCalledWith(expect.stringContaining("g1"));
|
expect(runtime.log).toHaveBeenCalledWith(expect.stringContaining("g1"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("passes gifPlayback to gateway send", async () => {
|
||||||
|
callGatewayMock.mockClear();
|
||||||
|
callGatewayMock.mockResolvedValueOnce({ messageId: "g1" });
|
||||||
|
const deps = makeDeps();
|
||||||
|
await sendCommand(
|
||||||
|
{
|
||||||
|
to: "+1",
|
||||||
|
message: "hi",
|
||||||
|
gifPlayback: true,
|
||||||
|
},
|
||||||
|
deps,
|
||||||
|
runtime,
|
||||||
|
);
|
||||||
|
expect(callGatewayMock).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
method: "send",
|
||||||
|
params: expect.objectContaining({ gifPlayback: true }),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("routes to telegram provider", async () => {
|
it("routes to telegram provider", async () => {
|
||||||
const deps = makeDeps({
|
const deps = makeDeps({
|
||||||
sendMessageTelegram: vi
|
sendMessageTelegram: vi
|
||||||
|
|||||||
Reference in New Issue
Block a user