mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 00:40:44 +00:00
test: tighten extension shape assertions
This commit is contained in:
@@ -272,7 +272,8 @@ describe("parseLineDirectives", () => {
|
||||
expect(flexMessage.contents?.footer?.contents?.length, testCase.name).toBeGreaterThan(0);
|
||||
}
|
||||
if ("expectBodyContents" in testCase && testCase.expectBodyContents) {
|
||||
expect(flexMessage.contents?.body?.contents, testCase.name).toEqual(expect.any(Array));
|
||||
expect(Array.isArray(flexMessage.contents?.body?.contents), testCase.name).toBe(true);
|
||||
expect(flexMessage.contents?.body?.contents?.length, testCase.name).toBeGreaterThan(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -96,7 +96,17 @@ describe("FileBackedMatrixSyncStore", () => {
|
||||
type: "com.openclaw.test",
|
||||
},
|
||||
]);
|
||||
expect(savedSync?.roomsData.join?.["!room:example.org"]).toEqual(expect.any(Object));
|
||||
expect(savedSync?.roomsData.join?.["!room:example.org"]).toMatchObject({
|
||||
timeline: {
|
||||
events: [
|
||||
{
|
||||
event_id: "$message",
|
||||
sender: "@user:example.org",
|
||||
type: "m.room.message",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
expect(secondStore.hasSavedSyncFromCleanShutdown()).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ describe("nostr-profile-http", () => {
|
||||
const data = expectBadRequestResponse(res);
|
||||
// The schema validation catches non-https URLs before SSRF check
|
||||
expect(data.error).toBe("Validation failed");
|
||||
expect(data.details).toEqual(expect.any(Array));
|
||||
expect(Array.isArray(data.details)).toBe(true);
|
||||
expect(data.details).toEqual(expect.arrayContaining([expect.stringContaining("https")]));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user