feat(gamification): expand badge tiers and count only outgoing likes

This commit is contained in:
2026-10-02 13:00:49 +03:30
parent f496474014
commit ba829055a5
5 changed files with 33 additions and 13 deletions

View File

@@ -26,7 +26,12 @@ def test_authenticated_summary_returns_progress_and_activity_breakdown(client, u
assert summary["activity_counts"]["attendance"] == 1
assert "attendance-1" in {badge["id"] for badge in summary["badges"]}
assert summary["points_per_activity"] == {"attendance": 30, "post": 20, "comment": 5, "like": 1, "save": 1}
assert summary["badge_thresholds"]["likes"] == [10, 50, 100]
assert summary["badge_thresholds"] == {
"attendance": [1, 5, 10, 25],
"posts": [1, 5, 10, 25],
"comments": [1, 5, 20, 50],
"likes": [1, 10, 50, 100],
}
def test_public_profile_exposes_badges_but_never_points_even_when_details_are_hidden(

View File

@@ -30,7 +30,8 @@ def test_publish_coauthor_like_and_save_award_expected_contributions(user_factor
assert summary_for_user(coauthor)["points_total"] == 22
assert summary_for_user(actor)["points_total"] == 2
assert summary_for_user(actor)["activity_counts"]["likes"] == 1
assert summary_for_user(coauthor)["activity_counts"]["likes"] == 1
assert summary_for_user(author)["activity_counts"]["likes"] == 0
assert summary_for_user(coauthor)["activity_counts"]["likes"] == 0
post.writers.remove(coauthor)
post.writers.remove(author)