WIP: feat: Missing notification when another user comments on a post the user commented on #142

Draft
typosaurus wants to merge 5 commits from typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th into master
Showing only changes of commit 9eb1cc6cfa - Show all commits

View File

@ -46,3 +46,44 @@ def test_member_cannot_set_default(bob):
)
assert response.status_code in (302, 303, 403)
assert get_notification_default("level", "push") is True
def test_admin_page_renders_participation_defaults(alice):
_, admin_user = alice
admin = _user_notification_prefs(admin_user["username"])
response = requests.get(
f"{BASE_URL}/admin/notifications",
headers={"X-API-KEY": admin["api_key"]},
allow_redirects=False,
)
assert response.status_code == 200
html = response.text
assert "Post participation" in html, (
"Admin notifications page should contain 'Post participation' label"
)
assert "Someone else comments on a post you also commented on" in html, (
"Admin notifications page should contain participation description"
)
assert 'data-type="participation" data-channel="in_app"' in html, (
"Participation in_app row should exist"
)
assert 'data-type="participation" data-channel="in_app" checked' in html, (
"Participation in_app default should be checked (on)"
)
assert 'data-type="participation" data-channel="push"' in html, (
"Participation push row should exist"
)
assert 'data-type="participation" data-channel="push" checked' in html, (
"Participation push default should be checked (on)"
)
assert 'data-type="participation" data-channel="telegram"' in html, (
"Participation telegram row should exist"
)
assert (
'data-type="participation" data-channel="telegram" checked' not in html
), "Participation telegram default should NOT be checked (off)"