Add authorization-boundary, integration and component tests
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- csharp, sqlite
调研方向
从 LearnStack.Core.Tests 开始,阅读现有的服务测试,然后检查 LearnStack.Core.Tests/LearnStack.Core.Tests.csproj:9 以及列出的流程和组件。当错误用户案例、端到端身份验证和共享流程、组件测试以及 CI 中强制执行的覆盖率满足所列验收标准时,工作即告完成。
由索引模型根据 Issue 内容生成。
描述
Tier 3 — testing
Problem
There are 38 tests, all in LearnStack.Core.Tests, all covering service-level happy paths against SQLite. Nothing covers the parts most likely to cause a production incident:
- Authorization boundaries — can user A read, update or delete user B's resources, ideas or groups? The services take
userIdas a parameter and every caller must pass the right one; that contract is untested. - The share-token flow and the anonymous
/shared/{token}page - The friend invitation accept flow (expiry, self-accept, double-accept)
- Any Blazor component (no bUnit)
- No coverage threshold, and
coverlet.collectoris referenced but not enforced
Evidence
LearnStack.Core.Tests/—UrlNormalizerTests(6),ContentIdeaServiceTests(19),LearningResourceServiceTests(12),OpenGraphServiceTests(7)LearnStack.Core.Tests/LearnStack.Core.Tests.csproj:9— coverlet present, unused
Proposed fix
- Add a cross-user authorization test per service method.
- Add a
WebApplicationFactoryintegration test project covering register → login → create → share → anonymous view, and the friend-invitation edge cases. - Add bUnit tests for
ResourceForm,ResourceCardand the Pulse components. - Enforce a coverage floor in CI.
Acceptance criteria
- Every service method has a "wrong user" test
- Auth and sharing flows covered end to end
- Coverage reported in CI and enforced
- 主要语言
- HTML
- 星标
- 10
- 派生
- 0
- 平均合并
- 2 小时 35 分钟
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kasuken/LearnStack 的其他 Issue
-
enhancement
难度 1/5 1 小时以内 新手友好度 91/100
kasuken/LearnStack#59 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
kasuken/LearnStack#72 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
kasuken/LearnStack#71 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
kasuken/LearnStack#70 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
kasuken/LearnStack#69 ·
维护者通常 1 天内回复
查看 kasuken/LearnStack 的全部 Issue
相似的 Issue
-
security
难度 2/5 1-3 小时 新手友好度 84/100
btclib-org/btclib-wallet#478 ·
维护者通常 1 天内回复
-
security
难度 2/5 1-3 小时 新手友好度 75/100
btclib-org/btclib#2727 ·
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 82/100
steerion-labs/bounded-agent-runtime#92 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
paperclipai/paperclip#16783 ·
维护者通常 1 天内回复
-
bug frontend help wanted
难度 2/5 1-3 小时 新手友好度 65/100
techtankto/techtank-site#262 ·
维护者通常 1 天内回复