mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-04 19:43:43 +08:00
32 lines
941 B
TypeScript
32 lines
941 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { normalizeRoomInfoRow } from '../../src/main/wcdb4-client'
|
|
|
|
describe('normalizeRoomInfoRow', () => {
|
|
it('maps versioned chatroom column aliases', () => {
|
|
expect(
|
|
normalizeRoomInfoRow('123@chatroom', {
|
|
chatroomname: '123@chatroom',
|
|
roomowner: 'wxid_owner',
|
|
textannouncement: '群公告',
|
|
announcement_editor_: 'wxid_editor',
|
|
max_member_count: 500,
|
|
chatroomnick: '测试群',
|
|
openim_acct_type: '2'
|
|
})
|
|
).toEqual({
|
|
roomId: '123@chatroom',
|
|
owner: 'wxid_owner',
|
|
announcement: '群公告',
|
|
announcementEditor: 'wxid_editor',
|
|
maxMemberCount: 500,
|
|
chatName: '测试群',
|
|
openImAccountType: '2',
|
|
isOpenIm: true
|
|
})
|
|
expect(normalizeRoomInfoRow('9@chatroom', { room_owner: 'wxid_b' })).toMatchObject({
|
|
owner: 'wxid_b',
|
|
isOpenIm: undefined
|
|
})
|
|
})
|
|
})
|