Repository navigation
Conversation
Contributor
Author
|
我先看到了 main 上的 我起初是按「恢复 Proxy 的实时读取」来修这 3 个 UI 用例如的,但既然 fixture 现在不可变、生产代码也不该依赖可变桥,那我这份改动就是多余的了,而且会在 main 上重新造一个 本机验证结果留档(万一以后需要):getter 方案下 另外 #4(下拉框弹层 / 聚焦环)我会 rebase 到最新 main 上重跑,稍后更新。 |
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.
背景
#3 修掉了「点添加账号报 proxy 不变量错误」,但把
apiFor()从「Proxy 实时读取」改成了「一次性拷贝方法值」,引入了回归:main上的npm run test:ui现在是失败的(macOS 作业,run 40266561479)。本 PR 修复这个回归。失败的 3 个用例:
overview handles absent usage, quotas and API state without manufactured chart dataextended task confirmation separates compatibility records from paid actions and shows each manual reasonnative popup layout shows the original icon, credits and reward actions原因
这几个用例会在页面挂载后替换 bridge 上的方法(
tests/ui.spec.ts的window.workbuddy.snapshot = …、Object.assign(window.workbuddy, { … })等)。原来的 Proxy 通过gettrap 在调用时读取,所以能看到替换后的函数;而 #3 的实现把这些函数值拷贝进了普通对象,apiFor()第一次调用时就把旧函数固定下来,App 之后一直用旧函数 —— 于是「暂无用量记录」的空状态不出现、任务上限从 1 变成 2,断言自然对不上。修复
拷贝改成 getter 实时读取,其余结构不变:
workbuddy-global的 scope 转发与「仅国内版」拦截)用override()定义成数据属性;登录包装也改成调用时再读target[key],替换后依然生效。验证
a bridge method replaced after the api was handed out is still used—— 先取 api,再替换 bridge 上的方法,断言 api 用的是新函数。修复前该用例失败。npx playwright test(完整 36 项 UI 用例,Windows + 本地 Chromium):36 通过,含上面失败的 3 项。npm test:205 通过,0 失败,2 跳过。npm run typecheck、npm run build通过。说明
#4(下拉框弹层与聚焦环)当前 CI 会是红的,因为它基于这之前的
main;本 PR 合并后我会把 #4 rebase 到最新main再确认。