Some things are very difficult to test programmatically. Also, if you don't have adequate test coverage, a good first step is a comprehensive manual test script! https://blog.scottnonnenberg.com/web-application-test-strategy/
(dismissed three ways: 1. sending a message 2. receiving new message while visible and focused 3. switching away from conversation and back again)
- Switch away from Signal app, but keep it visible
- Receive messages to conversation out of focus, and the last seen indicator should move up the screen with each new message. When the number of new messages can no longer fit on the screen, the last seen indicator should stay at the top of the screen, and new messages will appear below. The scroll down button will turn blue to indicate new messages out of view.
- Switch back to Signal app, and the last seen indicator and scroll down button should stay where they are
- Click the scroll down button to go to the bottom of the window, and it should disappear
- Send a message, then scroll up. The last seen indicator should be gone.
- Switch to a different conversation, then receive messages on original conversation
- Switch back to original conversation, and the last seen indicator should be visible
- Receive another message on that conversation while it has focus, and the last seen indicator should disappear
- Switch to a different conversation, then receive messages on original conversation
- Switch back to original conversation, and the last seen indicator should be visible
- Switch away from conversation and back. The last seen indicator should be gone.
- ADVANCED: Set fetch limit to a low number, like 3 (in models/messages.js, fetchConversation function). Load the application, and don't select the conversation. Receive more than four new messages in that conversation. Select the conversation. The last seen indicator should reflect the total number of new messages and all of them should be visible.