Repository navigation
test(ui): rewardsMenuIcon 切片对齐 #49 后的 footer 形态,修复 main 上静默崩溃 - #58
Open
yachen4ever wants to merge 1 commit into
Open
yachen4ever wants to merge 1 commit into
yachen4ever wants to merge 1 commit into
Conversation
…n 上静默崩溃 ZCodium-project#49 移除登录入口后源文件不再含 {onLogin && !user 标记,原切片 indexOf 返回 -1 切出残缺 JSX,转译抛 SyntaxError。改为按 rewards-menu-item 锚点定位其自包含的 {user ? (…) : null} 块并拼接平衡表达式,边界加显式断言防标记漂移静默化。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #55
改动(1 文件,+8/−3)
packages/ui/test/rewardsMenuIcon.test.ts第一个用例的源码切片逻辑更新:WorkspaceSidebarFooter.tsx的登录入口,源文件里已不存在该用例依赖的结尾标记{onLogin && !user,indexOf返回 -1 后切出残缺 JSX,转译即抛SyntaxError: Unexpected token ')'——main 上静默失败(仓库 CI 无 test:unit job)。data-testid="rewards-menu-item"锚点定位其所属的{user ? (<DropdownMenuItem>…) : null}自包含块(fix(ui): remove footer login entry and restore fa-IR shortcut #49 之后 rewards 条目即此形态),拼接成平衡表达式后转译。用例的验收语义不变:匿名渲染为空、登录后渲染出 rewards 菜单项与奖励徽标;同文件其余 3 个用例未动。
验证
pnpm test:unit packages/ui/test/rewardsMenuIcon.test.ts:4/4 通过(修复前 1/4)。pnpm lint:0 错误。