mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 16:54:46 +00:00
test: tighten small command assertions
This commit is contained in:
@@ -70,14 +70,13 @@ describe("buildProviderStatusIndex", () => {
|
||||
);
|
||||
expect(resolveAccount).not.toHaveBeenCalled();
|
||||
expect(inspectAccount).toHaveBeenCalledWith({}, "work");
|
||||
expect(map.get("workchat:work")).toMatchObject({
|
||||
provider: "workchat",
|
||||
accountId: "work",
|
||||
state: "linked",
|
||||
configured: true,
|
||||
enabled: true,
|
||||
name: "Work",
|
||||
});
|
||||
const status = map.get("workchat:work");
|
||||
expect(status?.provider).toBe("workchat");
|
||||
expect(status?.accountId).toBe("work");
|
||||
expect(status?.state).toBe("linked");
|
||||
expect(status?.configured).toBe(true);
|
||||
expect(status?.enabled).toBe(true);
|
||||
expect(status?.name).toBe("Work");
|
||||
});
|
||||
|
||||
it("records accounts that throw during read-only resolution as not configured", async () => {
|
||||
|
||||
@@ -154,9 +154,8 @@ describe("dashboardCommand", () => {
|
||||
// hint string is written to runtime.log, which flows into the same
|
||||
// console-captured log file readable by operator.read-scoped devices.
|
||||
expect(formatControlUiSshHintMock).toHaveBeenCalledWith({ port: 18789, basePath: undefined });
|
||||
expect(formatControlUiSshHintMock).not.toHaveBeenCalledWith(
|
||||
expect.objectContaining({ token: expect.anything() }),
|
||||
);
|
||||
const [sshHintOptions] = formatControlUiSshHintMock.mock.calls[0] ?? [];
|
||||
expect(sshHintOptions).not.toHaveProperty("token");
|
||||
|
||||
// Double-check: no logged line contains the secret.
|
||||
for (const call of runtime.log.mock.calls) {
|
||||
|
||||
@@ -56,11 +56,9 @@ describe("models/shared", () => {
|
||||
update: { channel: "beta" },
|
||||
}));
|
||||
|
||||
expect(mocks.replaceConfigFile).toHaveBeenCalledWith({
|
||||
nextConfig: expect.objectContaining({
|
||||
update: { channel: "beta" },
|
||||
}),
|
||||
baseHash: "config-1",
|
||||
});
|
||||
expect(mocks.replaceConfigFile).toHaveBeenCalledOnce();
|
||||
const [replaceParams] = mocks.replaceConfigFile.mock.calls[0] ?? [];
|
||||
expect(replaceParams?.nextConfig.update).toEqual({ channel: "beta" });
|
||||
expect(replaceParams?.baseHash).toBe("config-1");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user