fix(mobile-next): 我的信息改走 OpenIM SDK,避免账号服务 404
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
1895830907
commit
9001688c9e
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:openim_common/openim_common.dart';
|
||||
|
||||
void main() {
|
||||
test('把 OpenIM 公开资料映射成我的信息可用字段', () {
|
||||
final info = UserFullInfoMapper.fromImJson({
|
||||
'userID': '10001',
|
||||
'nickname': '张三',
|
||||
'faceURL': 'http://example/a.png',
|
||||
'ex': '',
|
||||
'globalRecvMsgOpt': 0,
|
||||
});
|
||||
expect(info.userID, '10001');
|
||||
expect(info.nickname, '张三');
|
||||
expect(info.faceURL, 'http://example/a.png');
|
||||
expect(info.globalRecvMsgOpt, 0);
|
||||
});
|
||||
|
||||
test('不把 chat 业务字段当成仍可从账号服务拿到', () {
|
||||
final info = UserFullInfoMapper.fromImJson({
|
||||
'userID': '10001',
|
||||
'nickname': '张三',
|
||||
'phoneNumber': '13800000000',
|
||||
'email': 'a@b.c',
|
||||
'gender': 1,
|
||||
});
|
||||
expect(info.userID, '10001');
|
||||
expect(info.nickname, '张三');
|
||||
expect(info.phoneNumber, isNull);
|
||||
expect(info.email, isNull);
|
||||
expect(info.gender, isNull);
|
||||
});
|
||||
|
||||
test('空列表保持为空', () {
|
||||
expect(UserFullInfoMapper.fromImList(const []), isEmpty);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user