Skip to content

tests: add 'being mentioned' notification e2e tests#1639

Open
catch-21 wants to merge 3 commits intodevfrom
catch-21/mention-notif-e2e
Open

tests: add 'being mentioned' notification e2e tests#1639
catch-21 wants to merge 3 commits intodevfrom
catch-21/mention-notif-e2e

Conversation

@catch-21
Copy link
Copy Markdown
Collaborator

@catch-21 catch-21 commented Apr 3, 2026

This PR introduces tests for both enabled and disabled notification settings when profile is mentioned.
Disabled is skipped due to bug #1603

@catch-21 catch-21 self-assigned this Apr 3, 2026
@catch-21 catch-21 added the 🧪 tests Unit or integration testing needs label Apr 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🚀 Preview Deployment

URL: https://franky-preview-pr-1639-fzxmjul7ya-oa.a.run.app

franky-preview-pr-1639b996048

@catch-21 catch-21 requested a review from Taewa April 3, 2026 15:58
@catch-21 catch-21 marked this pull request as ready for review April 3, 2026 15:58
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 3, 2026

Greptile Summary

This PR implements and enables the can be notified for profile being mentioned in a post E2E test that was previously a pending stub. It adds a createQuickPostWithMention helper, a new profile3 fixture for the skipped disabled-notification variant, and a data-cy="mention-popover" attribute on MentionPopover to expose the element to Cypress selectors. The skipped disabled-notification test is correctly guarded with a link to bug #1603.

Confidence Score: 5/5

Safe to merge — test-only changes with a minimal, additive component attribute addition.

All changes are confined to Cypress E2E tests and a single non-breaking data-cy attribute. No production logic is altered, no P0/P1 issues were found, and the implementation closely mirrors existing patterns in the codebase.

No files require special attention.

Important Files Changed

Filename Overview
cypress/e2e/notifications.cy.ts Implements the pending mention-notification test and adds a correctly-skipped disabled-notification variant; profile3 fixture and beforeEach alias follow existing patterns.
cypress/support/posts.ts Adds createQuickPostWithMention helper that mirrors the existing createQuickPost pattern, including cy.intercept placement inside .within().
src/components/molecules/MentionPopover/MentionPopover.tsx Adds data-cy="mention-popover" attribute alongside the existing data-testid to support Cypress targeting; no logic change.

Sequence Diagram

sequenceDiagram
    participant P1 as Profile 1
    participant App as App (Pubky)
    participant P2 as Profile 2

    P1->>App: createQuickPostWithMention(profile2.username)
    App-->>P1: PUT /posts/** 201

    P2->>App: sign in
    P2->>App: check notification counter (expects 1)
    P2->>App: navigate to profile page (resets counter to 0)
    P2->>App: verify latest notification: "mentioned you in post" (Unread)
    P2->>App: causeNotificationsToBeRead()
    P2->>App: verify latest notification: "mentioned you in post" (Read)
Loading

Reviews (1): Last reviewed commit: "tests: update snapshot" | Re-trigger Greptile

@catch-21 catch-21 changed the title tests: implement and enable 'can be notified for profile being mentioned in a post' notification e2e tests: implement and enable 'being mentioned' notification e2e tests Apr 3, 2026
@catch-21 catch-21 changed the title tests: implement and enable 'being mentioned' notification e2e tests tests: add 'being mentioned' notification e2e tests Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧪 tests Unit or integration testing needs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant