mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 12:24:47 +00:00
test: clarify msteams attachment url assertions
This commit is contained in:
@@ -313,7 +313,12 @@ describe("msteams graph attachments", () => {
|
||||
|
||||
expectAttachmentMediaLength(media.media, 0);
|
||||
const calledUrls = fetchMock.mock.calls.map((call) => call[0]);
|
||||
expect(calledUrls.some((url) => url.startsWith(GRAPH_SHARES_URL_PREFIX))).toBe(true);
|
||||
expect(calledUrls).toEqual([
|
||||
DEFAULT_MESSAGE_URL,
|
||||
expect.stringContaining(GRAPH_SHARES_URL_PREFIX),
|
||||
`${DEFAULT_MESSAGE_URL}/hostedContents`,
|
||||
expect.stringContaining(GRAPH_SHARES_URL_PREFIX),
|
||||
]);
|
||||
expect(calledUrls).not.toContain(escapedUrl);
|
||||
});
|
||||
|
||||
|
||||
@@ -638,8 +638,8 @@ describe("msteams attachments", () => {
|
||||
return resolveRequestUrl(input);
|
||||
});
|
||||
// Should have hit the original host, NOT graph shares.
|
||||
expect(calledUrls.some((url) => url === directUrl)).toBe(true);
|
||||
expect(calledUrls.some((url) => url.startsWith(GRAPH_SHARES_URL_PREFIX))).toBe(false);
|
||||
expect(calledUrls).toContain(directUrl);
|
||||
expect(calledUrls.filter((url) => url.startsWith(GRAPH_SHARES_URL_PREFIX))).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user