test(e2e): repair the legacy workflow fixture - #14
Open
coollugi wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVBKX88XEgSHGrxzsL2Zjj
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.
normalizes legacy approval policy defaults before saving目前在main上是失敗的,本 PR 修正它的 fixture現象
在乾淨的
main(d8feb9a)上執行會停在
page.getByRole('button', { name: '簽核節點' }).click()逾時兩個原因
一、fixture 的 edges 沒有
data,設計器在載入時就崩潰readLegacyWorkflowDefinition產生的連線是{ id, source, target },沒有data而
libs/shared/src/lib/workflow-toolset.ts:499的readEdgeSnapshot直接讀取於是頁面丟出
Cannot read properties of undefined (reading 'condition'),整個設計器渲染不出來測試看到的「找不到按鈕」只是這個崩潰的下游症狀
二、節點 id 缺少
userTask_前綴,存草稿會被 mock 的守衛擋下workflowDefinitionHasLinearTask要求start → userTask_* → end,而 fixture 用的是task_review真實的
createWorkflowNode產生的是userTask_1,所以守衛本身是正確的,是 fixture 沒有對齊修法
fixture 補上
data: {}並把節點 id 改為userTask_1,共 3 行修改後該測試通過(本機實跑 731ms),
pnpm typecheck與pnpm lint皆為 6 個 project 全過附帶回報,未在本 PR 處理
edge.data在下列位置也是直接解參考,沒有防禦從設計器建立的流程一定會帶
data(createWorkflowEdge會給{}),所以畫面操作不會踩到但透過 API 或腳本寫入的流程若省略了
data,開啟設計器就會是白畫面要不要保證
edge.data必然存在,屬於資料契約層的取捨,可能適合在載入時統一補值(如同
normalizeUserTaskPolicies對節點所做的),而不是在每個讀取點各自防禦這部分留給貴方判斷,本 PR 不做更動