test: isolate Star invitation state and stabilize late-result waits (#6076)

* test: isolate Star invitation state and relax late-result deadline

* test: keep invitation fixtures outside test workspaces
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-06 02:49:50 +08:00
1 parent 07c4e3f0d1
commit 42f06ab1dc
4 files changed
+20 -10

No files matched your search

@@ -4208,13 +4208,11 @@ def test_bootstrap_secret_also_enforced_on_localhost(bus: MagicMock) -> None:
@pytest.mark.asyncio
async def test_star_prompt_requires_authenticated_mutation_and_persists_dismissal(
bus: MagicMock, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
bus: MagicMock,
) -> None:
from nanobot.webui.star_prompt import StarPromptState
from nanobot.webui.star_prompt import StarPromptState, get_webui_dir
monkeypatch.setattr("nanobot.config.paths.get_data_dir", lambda: tmp_path)
state_path = tmp_path / "webui" / "star-prompt.json"
state_path.parent.mkdir()
state_path = get_webui_dir() / "star-prompt.json"
state_path.write_text(StarPromptState(
completed_replies=10, active_days=["2026-09-20", "2026-09-21", "2026-09-22"]
).model_dump_json(), encoding="utf-8")