Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/nuauto/onboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading