feat: include Following and My PRs in queue census (Closes #1452)
This commit is contained in:
1 parent
977493907e
commit
4b4637fadb
3 files changed
+94
-4
No files matched your search
@@ -300,6 +300,33 @@ async def test_mobile_queue_sheet_prioritizes_next_active_and_planning_without_d
|
||||
assert html.count(f'<button data-mobile-queue="{name}"') == 1
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_following_hydration_refreshes_the_persistent_mobile_queue_census():
|
||||
html = await dashboard()
|
||||
|
||||
assert (
|
||||
"preparationItems.following = items.filter(item => item.has_unseen_change === true);\n"
|
||||
" renderMobileQueuePresentation();\n"
|
||||
" mobileTaskDock.updateQueues(queueCounts);\n"
|
||||
" mobileStartDay.render();"
|
||||
) in html
|
||||
assert (
|
||||
"queueCounts.followingUnavailable = status === 'error';\n"
|
||||
" renderMobileQueuePresentation();\n"
|
||||
" mobileTaskDock.updateQueues(queueCounts);\n"
|
||||
" mobileStartDay.render();"
|
||||
) in html
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_my_work_refresh_preserves_the_hydrated_following_queue():
|
||||
html = await dashboard()
|
||||
|
||||
assert "counts.following = queueCounts.following;" in html
|
||||
assert "counts.followingUnavailable = queueCounts.followingUnavailable;" in html
|
||||
assert "following:preparationItems.following || []," in html
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_find_and_queue_detours_are_visible_and_wired_to_today_timing():
|
||||
html = await dashboard()
|
||||
@@ -548,7 +575,7 @@ process.stdout.write(JSON.stringify({{
|
||||
"populated": {
|
||||
"badge": "8 active",
|
||||
"badgeHidden": False,
|
||||
"badgeLabel": "Queues: Today 2, Agenda 5 due, Delivery 1, Human Gates 2, Attention 1, Updates 5, Filed 2, Later 3, Drafts 4; 8 active queues",
|
||||
"badgeLabel": "Queues: Today 2, Agenda 5 due, Delivery 1, Human Gates 2, Attention 1, Updates 5, Following 0, Filed 2, My PRs 0, Later 3, Drafts 4; 8 active queues",
|
||||
"deadline": "5 due",
|
||||
"deadlineHidden": False,
|
||||
"agendaDue": "true",
|
||||
@@ -557,7 +584,7 @@ process.stdout.write(JSON.stringify({{
|
||||
"badge": "1 active",
|
||||
"badgeHidden": False,
|
||||
"deadlineHidden": True,
|
||||
"badgeLabel": "Queues: Today 0, Agenda 0 due, Delivery 0, Human Gates 0, Attention 0, Updates 7, Filed 0, Later 0, Drafts 0; 1 active queue",
|
||||
"badgeLabel": "Queues: Today 0, Agenda 0 due, Delivery 0, Human Gates 0, Attention 0, Updates 7, Following 0, Filed 0, My PRs 0, Later 0, Drafts 0; 1 active queue",
|
||||
},
|
||||
"clearedBadgeHidden": True,
|
||||
"clearedDeadlineHidden": True,
|
||||
@@ -570,6 +597,59 @@ process.stdout.write(JSON.stringify({{
|
||||
}
|
||||
|
||||
|
||||
def test_mobile_task_dock_counts_following_and_authored_work_truthfully():
|
||||
script = f"""
|
||||
const createDock = require({json.dumps(str(DOCK))});
|
||||
const node = () => ({{
|
||||
textContent:'', hidden:false, attributes:{{}},
|
||||
setAttribute(name, value) {{ this.attributes[name] = value; }},
|
||||
removeAttribute(name) {{ delete this.attributes[name]; }},
|
||||
}});
|
||||
const queues = node();
|
||||
const badge = node();
|
||||
const deadline = node();
|
||||
const following = node();
|
||||
const authored = node();
|
||||
const dock = createDock({{
|
||||
nav:node(), buttons:{{queues}}, queueBadge:badge, deadlineBadge:deadline,
|
||||
queueRows:{{following, authored}},
|
||||
queueCounts:{{following:node(), authored:node()}},
|
||||
}});
|
||||
dock.updateQueues({{following:3, authored:2}});
|
||||
const active = {{
|
||||
badge:badge.textContent,
|
||||
badgeHidden:badge.hidden,
|
||||
summary:queues.attributes['aria-label'],
|
||||
followingCount:dock ? following.attributes['aria-label'] : null,
|
||||
}};
|
||||
dock.updateQueues({{following:0, authored:0}});
|
||||
process.stdout.write(JSON.stringify({{
|
||||
active,
|
||||
cleared:{{
|
||||
badgeHidden:badge.hidden,
|
||||
summary:queues.attributes['aria-label'],
|
||||
followingLabel:following.attributes['aria-label'],
|
||||
}},
|
||||
}}));
|
||||
"""
|
||||
result = subprocess.run(["node", "-e", script], capture_output=True, text=True)
|
||||
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert json.loads(result.stdout) == {
|
||||
"active": {
|
||||
"badge": "2 active",
|
||||
"badgeHidden": False,
|
||||
"summary": "Queues: Today 0, Agenda 0 due, Delivery 0, Human Gates 0, Attention 0, Updates 0, Following 3, Filed 0, My PRs 2, Later 0, Drafts 0; 2 active queues",
|
||||
"followingCount": "Following, 3 unseen changes",
|
||||
},
|
||||
"cleared": {
|
||||
"badgeHidden": True,
|
||||
"summary": "Queues: no active queues; no upcoming deadlines",
|
||||
"followingLabel": "Following, 0 unseen changes",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_mobile_queue_launcher_opens_first_actionable_item_after_selecting_queue():
|
||||
script = f"""
|
||||
const createLauncher = require({json.dumps(str(QUEUE_LAUNCHER))});
|
||||
|
||||
Reference in new issue
Block a user