feat: claim unowned work from Filed (Closes #893)
This commit is contained in:
1 parent
5105fb40d3
commit
c594cc20fc
8 files changed
+117
-1
No files matched your search
@@ -4,6 +4,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
ASSIGN_AND_START = Path(__file__).parents[1] / "frontend" / "assign-and-start.js"
|
||||
FILED_CLAIM = Path(__file__).parents[1] / "frontend" / "filed-claim.js"
|
||||
QUEUE_TODAY = Path(__file__).parents[1] / "frontend" / "queue-today.js"
|
||||
HTML = Path(__file__).parents[1] / "frontend" / "index.html"
|
||||
DASHBOARD = Path(__file__).parents[1] / "frontend" / "dashboard.js"
|
||||
@@ -17,6 +18,47 @@ def run_node(script):
|
||||
).stdout)
|
||||
|
||||
|
||||
def test_filed_claim_actions_require_open_authored_unassigned_canonical_issue():
|
||||
script = f"""
|
||||
const eligible=require({json.dumps(str(FILED_CLAIM))});
|
||||
const item={{is_filed:true,is_assigned:false,is_completed:false,state:'open'}};
|
||||
process.stdout.write(JSON.stringify({{
|
||||
eligible:eligible(item, {{state:'open',assignees:[]}}),
|
||||
assigned:eligible(item, {{state:'open',assignees:['alex']}}),
|
||||
closed:eligible(item, {{state:'closed',assignees:[]}}),
|
||||
ordinary:eligible({{...item,is_filed:false}}, {{state:'open',assignees:[]}}),
|
||||
}}));
|
||||
"""
|
||||
|
||||
assert run_node(script) == {
|
||||
"eligible": True,
|
||||
"assigned": False,
|
||||
"closed": False,
|
||||
"ordinary": False,
|
||||
}
|
||||
|
||||
|
||||
def test_filed_sheet_exposes_phone_safe_claim_actions_after_canonical_detail():
|
||||
html = HTML.read_text()
|
||||
dashboard = DASHBOARD.read_text()
|
||||
css = CSS.read_text()
|
||||
worker = WORKER.read_text()
|
||||
|
||||
assert 'id="filed-claim-actions"' in html
|
||||
assert 'id="queue-filed-issue"' in html
|
||||
assert 'id="start-filed-issue"' in html
|
||||
assert "filedClaimEligible(item, detail)" in dashboard
|
||||
assert "filedAssignAndStart.run(item, { destination:'queue' })" in dashboard
|
||||
assert "filedAssignAndStart.run(item)" in dashboard
|
||||
assert "Claim failed; this issue is still in Filed." in dashboard
|
||||
assert ".filed-claim-actions" in css
|
||||
action_rule = css.split(".filed-claim-actions", 1)[1].split("}", 1)[0]
|
||||
assert "grid-template-columns:repeat(2,minmax(0,1fr))" in action_rule
|
||||
assert "width:min(560px,100%)" in action_rule
|
||||
assert "BASE + 'static/filed-claim.js'" in worker
|
||||
assert '<script src="static/filed-claim.js"></script>' in html
|
||||
|
||||
|
||||
def test_repeated_assign_and_start_taps_claim_once_then_start_confirmed_issue():
|
||||
script = f"""
|
||||
const fs=require('fs');
|
||||
|
||||
@@ -883,6 +883,7 @@ def test_install_precaches_complete_subpath_scoped_app_shell():
|
||||
"/dashboard/static/create-issue-sheet.js",
|
||||
"/dashboard/static/create-and-start.js",
|
||||
"/dashboard/static/assign-and-start.js",
|
||||
"/dashboard/static/filed-claim.js",
|
||||
"/dashboard/static/queue-today.js",
|
||||
"/dashboard/static/pull-sheet.js",
|
||||
"/dashboard/static/review-sheet.js",
|
||||
|
||||
Reference in new issue
Block a user