mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 08:50:21 +00:00
fix(ci): repair main checks
This commit is contained in:
@@ -77,6 +77,9 @@ describe("googlechat message actions", () => {
|
||||
messageName: "spaces/AAA/messages/msg-1",
|
||||
});
|
||||
|
||||
if (!googlechatMessageActions.handleAction) {
|
||||
throw new Error("Expected googlechatMessageActions.handleAction to be defined");
|
||||
}
|
||||
const result = await googlechatMessageActions.handleAction({
|
||||
action: "send",
|
||||
params: {
|
||||
@@ -140,6 +143,9 @@ describe("googlechat message actions", () => {
|
||||
},
|
||||
]);
|
||||
|
||||
if (!googlechatMessageActions.handleAction) {
|
||||
throw new Error("Expected googlechatMessageActions.handleAction to be defined");
|
||||
}
|
||||
const result = await googlechatMessageActions.handleAction({
|
||||
action: "react",
|
||||
params: {
|
||||
|
||||
@@ -32,23 +32,32 @@ function createResponse() {
|
||||
statusCode: 0,
|
||||
headers: {} as Record<string, string>,
|
||||
body: "",
|
||||
setHeader(name: string, value: string) {
|
||||
this.headers[name] = value;
|
||||
setHeader: (name: string, value: string) => {
|
||||
res.headers[name] = value;
|
||||
},
|
||||
end(payload?: string) {
|
||||
this.body = payload ?? "";
|
||||
return this;
|
||||
end: (payload?: string) => {
|
||||
res.body = payload ?? "";
|
||||
return res;
|
||||
},
|
||||
} as unknown as ServerResponse & {
|
||||
headers: Record<string, string>;
|
||||
body: string;
|
||||
};
|
||||
} as ServerResponse & { headers: Record<string, string>; body: string };
|
||||
return res;
|
||||
}
|
||||
|
||||
function installSimplePipeline(targets: unknown[]) {
|
||||
withResolvedWebhookRequestPipeline.mockImplementation(
|
||||
async ({ handle, req, res }: Record<string, unknown>) =>
|
||||
async ({
|
||||
handle,
|
||||
req,
|
||||
res,
|
||||
}: {
|
||||
handle: (input: {
|
||||
targets: unknown[];
|
||||
req: IncomingMessage;
|
||||
res: ServerResponse;
|
||||
}) => Promise<unknown>;
|
||||
req: IncomingMessage;
|
||||
res: ServerResponse;
|
||||
}) =>
|
||||
await handle({
|
||||
targets,
|
||||
req,
|
||||
|
||||
@@ -4,6 +4,9 @@ import { googlechatSetupAdapter } from "./setup-core.js";
|
||||
|
||||
describe("googlechat setup core", () => {
|
||||
it("rejects env auth for non-default accounts", () => {
|
||||
if (!googlechatSetupAdapter.validateInput) {
|
||||
throw new Error("Expected googlechatSetupAdapter.validateInput to be defined");
|
||||
}
|
||||
expect(
|
||||
googlechatSetupAdapter.validateInput({
|
||||
accountId: "secondary",
|
||||
@@ -13,6 +16,9 @@ describe("googlechat setup core", () => {
|
||||
});
|
||||
|
||||
it("requires inline or file credentials when env auth is not used", () => {
|
||||
if (!googlechatSetupAdapter.validateInput) {
|
||||
throw new Error("Expected googlechatSetupAdapter.validateInput to be defined");
|
||||
}
|
||||
expect(
|
||||
googlechatSetupAdapter.validateInput({
|
||||
accountId: DEFAULT_ACCOUNT_ID,
|
||||
@@ -22,6 +28,9 @@ describe("googlechat setup core", () => {
|
||||
});
|
||||
|
||||
it("builds a patch from token-file and trims optional webhook fields", () => {
|
||||
if (!googlechatSetupAdapter.applyAccountConfig) {
|
||||
throw new Error("Expected googlechatSetupAdapter.applyAccountConfig to be defined");
|
||||
}
|
||||
expect(
|
||||
googlechatSetupAdapter.applyAccountConfig({
|
||||
cfg: { channels: { googlechat: {} } },
|
||||
@@ -51,6 +60,9 @@ describe("googlechat setup core", () => {
|
||||
});
|
||||
|
||||
it("prefers inline token patch when token-file is absent", () => {
|
||||
if (!googlechatSetupAdapter.applyAccountConfig) {
|
||||
throw new Error("Expected googlechatSetupAdapter.applyAccountConfig to be defined");
|
||||
}
|
||||
expect(
|
||||
googlechatSetupAdapter.applyAccountConfig({
|
||||
cfg: { channels: { googlechat: {} } },
|
||||
|
||||
Reference in New Issue
Block a user