@@ -49,6 +49,22 @@ def test_post_vote_increment(alice):
|
||||
assert count == "1", f"expected vote count 1, got {count!r}"
|
||||
|
||||
|
||||
def _profile_stars(page, username):
|
||||
page.goto(f"{BASE_URL}/profile/{username}", wait_until="domcontentloaded")
|
||||
value = page.locator(".profile-stat:has(.profile-stat-label:has-text('Stars')) .profile-stat-value").first
|
||||
return int(value.text_content().strip())
|
||||
|
||||
|
||||
def test_profile_stars_reflect_content_votes(alice):
|
||||
page, user = alice
|
||||
before = _profile_stars(page, user["username"])
|
||||
create_post(page, "devlog", "Reputation contribution post")
|
||||
page.locator(".post-action-btn.vote-up").first.click()
|
||||
page.wait_for_url(f"{BASE_URL}/posts/*", wait_until="domcontentloaded")
|
||||
after = _profile_stars(page, user["username"])
|
||||
assert after == before + 1, f"expected stars {before + 1}, got {after}"
|
||||
|
||||
|
||||
def test_post_comments_section(alice):
|
||||
page, _ = alice
|
||||
create_post(page, "rant", "Comment section test")
|
||||
|
||||
Reference in New Issue
Block a user