import { AuthService } from '../api'; import { createOptions } from '../test.config'; import { trim } from 'lodash'; import { matchRealname, matchMobile } from './matcher/string.matcher'; const factory = createOptions(); test('auth 00 广联云 token 加载 pengyc 用户对象', async () => { const user = await new AuthService(factory).loadCloudtUser(); console.log('loadCloudtUser(pengyc)', user); matchRealname(user.realname); matchMobile(user.mobile); }); test('auth 01 加载用户角色', async () => { const userId = 137454301650944; const roles = await new AuthService(factory).loadUserRoles('133116919562240/133118457434112/133118611058688', userId); // console.log('loadUserRoles', roles); expect(roles.userId).toBe(String(userId)); expect(roles.roles.length).toBeGreaterThan(0); });