Skip to content

Commit 73437fd

Browse files
committed
test: tighten openclaw test state assertions
1 parent b2d0e3e commit 73437fd

1 file changed

Lines changed: 16 additions & 29 deletions

File tree

test/scripts/openclaw-test-state.test.ts

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ describe("scripts/lib/openclaw-test-state", () => {
3737
"--json",
3838
]);
3939
const payload = JSON.parse(stdout);
40-
expect(payload).toMatchObject({
41-
label: "script-test",
42-
scenario: "update-stable",
43-
});
40+
expect(payload.label).toBe("script-test");
41+
expect(payload.scenario).toBe("update-stable");
4442
for (const field of ["root", "home", "stateDir", "configPath", "workspaceDir"] as const) {
4543
expect(typeof payload[field]).toBe("string");
4644
expect(payload[field].length).toBeGreaterThan(0);
@@ -151,33 +149,22 @@ describe("scripts/lib/openclaw-test-state", () => {
151149
const payload = JSON.parse(stdout);
152150
try {
153151
expect(payload.scenario).toBe("upgrade-survivor");
154-
expect(payload.config).toMatchObject({
155-
update: {
156-
channel: "stable",
157-
},
158-
gateway: {
159-
auth: {
160-
token: {
161-
id: "GATEWAY_AUTH_TOKEN_REF",
162-
source: "env",
163-
},
164-
},
165-
},
166-
channels: {
167-
discord: {
168-
enabled: true,
169-
dm: {
170-
policy: "allowlist",
171-
},
172-
},
173-
telegram: {
174-
enabled: true,
175-
},
176-
whatsapp: {
177-
enabled: true,
178-
},
152+
expect(payload.config.update).toStrictEqual({ channel: "stable" });
153+
expect(payload.config.gateway.auth).toStrictEqual({
154+
mode: "token",
155+
token: {
156+
id: "GATEWAY_AUTH_TOKEN_REF",
157+
provider: "default",
158+
source: "env",
179159
},
180160
});
161+
expect(payload.config.channels.discord.enabled).toBe(true);
162+
expect(payload.config.channels.discord.dm).toStrictEqual({
163+
allowFrom: ["111111111111111111"],
164+
policy: "allowlist",
165+
});
166+
expect(payload.config.channels.telegram.enabled).toBe(true);
167+
expect(payload.config.channels.whatsapp.enabled).toBe(true);
181168
} finally {
182169
await fs.rm(payload.root, { recursive: true, force: true });
183170
}

0 commit comments

Comments
 (0)