diff --git a/src/nuauto/onboard.py b/src/nuauto/onboard.py index 040fb13..becafef 100644 --- a/src/nuauto/onboard.py +++ b/src/nuauto/onboard.py @@ -679,8 +679,9 @@ def add(id_, title, done, detail="", optional=False, **data): out.append({"id": id_, "title": title, "status": "done" if done else "optional" if optional else "todo", "detail": detail, "data": data}) + from nuauto import sheet add("welcome", "Welcome", bool(cfg.get("tos_ack")), "You read NUworks' terms of use and know the limits.", - week=11, total=99) + week=sheet.max_per_week(), total=sheet.MAX_TOTAL) # the limits the code enforces (Settings > Applying) ff = checks.get("firefox") cl = checks.get("claude") tools_ok = bool(ff and ff.status == health.OK and cl and cl.status == health.OK) diff --git a/tests/test_setup.py b/tests/test_setup.py index e54b3cd..42c3b80 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -193,6 +193,11 @@ def mode(path): assert list(steps) == ["welcome", "tools", "google_client", "google_login", "sheet", "resume", "nuworks", "preferences", "extras", "internships", "password_manager", "homelab"] assert steps["welcome"]["status"] == "todo" and steps["extras"]["status"] == "optional" and not onboard.complete(list(steps.values())) +# the welcome step names the limits the code enforces: the weekly one from Settings (max_per_week), not a fixed 11 +from nuauto import sheet # noqa: E402 +config.LOCAL["max_per_week"] = 5 +assert next(s for s in onboard.steps({}) if s["id"] == "welcome")["data"] == {"week": 5, "total": sheet.MAX_TOTAL} +config.LOCAL.pop("max_per_week") os.remove(config.TOKEN_PATH) # the optional steps at the end: Password manager always; Assistant on your homelab only with a homelab (not on the