mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 09:15:41 +08:00
test(wecom): add synthetic tests for enterprise message support
This commit is contained in:
1 parent
eac16ad8a7
commit
8f37ded71e
6 files changed
+269
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { parseMessageContent } from '../../src/main/message-parser'
|
||||
|
||||
/** Synthetic payloads only — no real content, keys, or identifiers. */
|
||||
describe(`enterprise image content parsing`, () => {
|
||||
it(`recognizes an aeskey-only enterprise image`, () => {
|
||||
const xml = `<img aeskey="fixtureaeskey0000000000000000000" encryver="0" cdnmidimgurl="fixture-url"/>`
|
||||
const parsed = parseMessageContent(xml, 3)
|
||||
expect(parsed.type).toBe(`image`)
|
||||
if (parsed.type === `image`) {
|
||||
expect(parsed.md5).toBeUndefined()
|
||||
expect(parsed.aeskey).toBe(`fixtureaeskey0000000000000000000`)
|
||||
}
|
||||
})
|
||||
|
||||
it(`still rejects img content with no identity fields`, () => {
|
||||
expect(parseMessageContent('<img/>', 3).type).toBe('unknown')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user