Commit Graph

4 Commits

Author SHA1 Message Date
moyin
d4a7b36129 Merge branch 'main' of https://gitea.xinghangee.icu/datawhale/whale-town-end into ANGJustinl-main 2025-12-18 14:12:45 +08:00
moyin
3cfebbc4c4 fix: 修复测试用例中的问题
- 修复邮件服务测试中未使用的变量警告
- 修复验证服务测试中的TTL和返回值期望问题
- 确保所有113个测试用例通过

详细修改:
- email.service.spec.ts: 移除4个未使用的testService变量
- verification.service.spec.ts:
  * 添加TTL mock值避免异常分支
  * 更新getCodeStats期望值包含code和createdAt字段
  * 修正TTL期望值从-1改为-2(Redis标准)

测试结果: 6个测试套件,113个测试用例全部通过
2025-12-18 13:33:40 +08:00
angjustinl
6dece752ef test(email, verification, login): 更新测试中的断言内容, 修复测试error.
- Replace boolean assertions with structured result object checks in email service tests
- Update email service tests to verify success flag and isTestMode property
- Add error message assertions for failed email sending scenarios
- Change logger spy from 'log' to 'warn' for test mode email output
- Update test message to clarify emails are not actually sent in test mode
- Add code and createdAt properties to verification code stats mock data
- Fix TTL mock value from -1 to -2 to correctly represent non-existent keys
- Replace Inject decorator with direct UsersService type injection in LoginCoreService
- Ensure verification service tests properly mock TTL values during code verification
- Improve test coverage by validating complete response structures instead of simple booleans
2025-12-18 13:29:55 +08:00
moyin
3e5c171ff6 feat:添加邮件服务
- 实现完整的邮件发送功能
- 支持验证码邮件发送
- 支持欢迎邮件发送
- 集成SMTP配置和Nodemailer
- 添加邮件模板和HTML格式支持
- 包含完整的单元测试
2025-12-17 20:21:11 +08:00