Skip to content

Commit ae1e034

Browse files
sjefferson99claude
andcommitted
test(notifications): add positive coverage for new-user install notification
Locks in that register()/setup_admin() actually produce the "Install AFT as an app" notification, not just that unrelated count assertions don't regress. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 6c4edaa commit ae1e034

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

server/tests/test_api_notifications.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,29 @@ def test_delete_all_only_affects_own_notifications(
12771277
)
12781278

12791279

1280+
@pytest.mark.api
1281+
class TestMobileAppInstallNotification:
1282+
"""Regression test for Issue 514: new users get a mobile app install notification."""
1283+
1284+
def test_new_user_receives_mobile_app_install_notification(
1285+
self, api_client, second_user_session
1286+
):
1287+
"""A freshly registered user should have the 'Install AFT as an app' notification."""
1288+
response = second_user_session.get(f'{api_client}/api/notifications')
1289+
assert response.status_code == 200
1290+
1291+
notifications = response.json()['notifications']
1292+
install_notif = next(
1293+
(n for n in notifications if n['subject'] == 'Install AFT as an app'), None
1294+
)
1295+
assert install_notif is not None, (
1296+
f"Expected an 'Install AFT as an app' notification for a new user, "
1297+
f"but found subjects: {[n.get('subject') for n in notifications]}"
1298+
)
1299+
assert install_notif['unread'] is True
1300+
assert install_notif['action_url'] == '/settings.html'
1301+
1302+
12801303
@pytest.mark.api
12811304
class TestNotificationMultiUserCreation:
12821305
"""Test cases for admin creating notifications for all users."""

0 commit comments

Comments
 (0)