perf: lazy-load pull request workspace (Closes #541)
CI / lint (pull_request) Successful in 1m4s
CI / build-release (pull_request) Successful in 4s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-11 04:53:18 +00:00
1 parent 3605c42651
commit 7d4ff1f095
6 files changed
+81 -15

No files matched your search

+21 -1
View File
@@ -68,4 +68,24 @@ console.log(JSON.stringify({loading,failedState,first,second,opened,finalStatus:
"second": True,
"opened": 1,
"finalStatus": "",
}
}
def test_pull_workspace_failure_is_accessible_and_retryable_from_same_card():
result = run_loader("""
const trigger={disabled:false}; const status={textContent:''}; let opened=0;
const loader=createFeatureLoader({document, urls:{'pull-workflow':'feature-pull.js'}, timeoutMs:100});
const failed=loader.run('pull-workflow',{trigger,status,retryLabel:'Tap the work card to retry.'},()=>{opened++;});
state.node.onerror(); const first=await failed;
const failedStatus=status.textContent;
const retry=loader.run('pull-workflow',{trigger,status,retryLabel:'Tap the work card to retry.'},()=>{opened++;});
state.node.onload(); const second=await retry;
console.log(JSON.stringify({first,second,failedStatus,opened,appends:state.appends}));
""")
assert result == {
"first": False,
"second": True,
"failedStatus": "Pull workspace could not load. Tap the work card to retry.",
"opened": 1,
"appends": 2,
}