test: 修复测试用例并提升测试覆盖率
- 修复 User Journey 测试中的菜单导航和登出问题 - 更新 vitest 配置以包含 role-based-tests - 修复 role-auth-manager 测试中的 mock 问题 - 测试通过率从 70% 提升到 100%
This commit is contained in:
@@ -50,7 +50,8 @@ describe('RoleAuthManager', () => {
|
||||
it('should throw error on authentication failure', async () => {
|
||||
(global.fetch as any).mockResolvedValueOnce({
|
||||
ok: false,
|
||||
statusText: 'Unauthorized'
|
||||
statusText: 'Unauthorized',
|
||||
text: async () => 'Invalid credentials'
|
||||
});
|
||||
|
||||
await expect(RoleAuthManager.getRoleToken('admin')).rejects.toThrow('Authentication failed');
|
||||
|
||||
Reference in New Issue
Block a user