test(pages): update assertions stale from prior UI refactors
Two pre-existing failures unrelated to autoscroll, both from earlier template redesigns that the corresponding tests never tracked: test_server_actions_fragment_polls_while_running Asserted data-sse-url="/jobs/<id>/stream" in the actions fragment. That streaming <pre> was removed when the inline job-log moved into #job-log-modal (see test_server_detail_no_inline_job_log_pre). Replace with the modal-open trigger assertion. test_workshop_overlay_refresh_button_hidden_during_build Used "building…" label as the positive companion that the build-running guard fired. The workshop overlay path now includes _overlay_build_status.html with omit_badge=True, so that label isn't rendered. Switch to hx-trigger="every 2s", which the partial emits unconditionally while a build is running. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8f5306db09
commit
aabe57b767
1 changed files with 10 additions and 5 deletions
|
|
@ -147,8 +147,6 @@ def test_server_actions_fragment_polls_while_running(auth_client_with_server) ->
|
||||||
with session_scope() as session:
|
with session_scope() as session:
|
||||||
job = Job(user_id=1, server_id=1, operation="start", state="queued")
|
job = Job(user_id=1, server_id=1, operation="start", state="queued")
|
||||||
session.add(job)
|
session.add(job)
|
||||||
session.flush()
|
|
||||||
job_id = job.id
|
|
||||||
|
|
||||||
response = auth_client_with_server.get("/servers/1/actions")
|
response = auth_client_with_server.get("/servers/1/actions")
|
||||||
text = response.get_data(as_text=True)
|
text = response.get_data(as_text=True)
|
||||||
|
|
@ -157,7 +155,10 @@ def test_server_actions_fragment_polls_while_running(auth_client_with_server) ->
|
||||||
assert 'id="server-actions"' in text
|
assert 'id="server-actions"' in text
|
||||||
assert "<html" not in text # fragment, not a full page
|
assert "<html" not in text # fragment, not a full page
|
||||||
assert 'hx-trigger="every 2s"' in text
|
assert 'hx-trigger="every 2s"' in text
|
||||||
assert f'data-sse-url="/jobs/{job_id}/stream"' in text
|
# Job-log streaming moved out of this fragment into #job-log-modal on
|
||||||
|
# the parent page (see test_server_detail_no_inline_job_log_pre in
|
||||||
|
# test_servers.py). The fragment now only triggers the modal.
|
||||||
|
assert 'data-inline-modal-open="job-log-modal"' in text
|
||||||
|
|
||||||
|
|
||||||
def test_server_actions_fragment_settles_when_terminal(auth_client_with_server) -> None:
|
def test_server_actions_fragment_settles_when_terminal(auth_client_with_server) -> None:
|
||||||
|
|
@ -772,5 +773,9 @@ def test_workshop_overlay_refresh_button_hidden_during_build(auth_client_with_se
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert "Refresh from Steam" not in text
|
assert "Refresh from Steam" not in text
|
||||||
# Positive companion: confirm the build-running guard actually fired,
|
# Positive companion: confirm the build-running guard actually fired,
|
||||||
# otherwise the negative could pass vacuously on a broken page.
|
# otherwise the negative could pass vacuously on a broken page. The
|
||||||
assert "building…" in text
|
# workshop overlay path includes _overlay_build_status.html with
|
||||||
|
# omit_badge=True, so the "building…" label is not rendered here; the
|
||||||
|
# 'hx-trigger="every 2s"' attribute is the unambiguous running-state
|
||||||
|
# signal that the partial emits regardless of omit_badge.
|
||||||
|
assert 'hx-trigger="every 2s"' in text
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue