* Attempt to deflake a read-receipts test
Hopefully, this will fix https://github.com/vector-im/element-web/issues/26679
(I think that the fourth message was arriving *after* the room was marked as
read, meaning that we ended up with two unread messages rather than one.)
* Update cypress/e2e/read-receipts/new-messages.spec.ts
* prettier
* Rewrite doesRoomOrThreadHaveUnreadMessages to use the receipt rewrite from js-sdk
* Remove unit tests that rely on receipt timestamps
Previously, if we found a receipt for an unknown event, we would use the
receipt timestamp and declare all events before that time to be read.
Now, we ignore such "dangling" receipts until we find the event they
refer to.
This new behaviour is more correct, but does lead to more messages being
considered unread.
This commit deletes tests that checked for the old behaviour.
* Check for a missing thread in determineUnreadState
* Fix incorrect way to find room timeline
* More realistic test setup to support new receipt code
* Update snapshot to expect a room to be unread when there are no receipts
* Formatting fixes
* Update snapshot to show menu and notif button
* Disable some flaky tests
* Disable some flaky tests
* Fix test to make a threaded receipt for an event that is actually in the thread
---------
Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Fill cypress test `high-level.spec.ts` > `A receipt for the last unimportant event makes the room read, even if all are unimportant`
* Test on `room2` instead of `room1`
* disable flaky cypress test `Paging up through old messages after a room is read leaves the room read`
* Update cypress/e2e/read-receipts/high-level.spec.ts
---------
Co-authored-by: Michael Weimann <michaelw@matrix.org>
* Disable two tests that flake after matrix-js-sdk#3798
* Enable tests that have been fixed by matrix-js-sdk#3798
* Disable two flaking tests
* Disable another flaking test
* Split the read-receipt tests into logical units
* Move read-receipt docs into a readme file
* Provide doc comments for exported functions in read-receipt tests
* Tests for redacting messages not increasing unreads
* Comment explaining tips for writing high level rr tests
* Test for restarting with a receipt pointing at a redacted thread root
* Two failing tests for counting correctly when a thread message was redacted
* Test for reading a thread containing an earlier redaction
* Failing tests for redacted messages in threads
* More tests for reactions to messages in threads
* Wait before looking for the thread list, to let the room settle
* Tests for redacting messages not increasing unreads
* Comment explaining tips for writing high level rr tests
* Test for restarting with a receipt pointing at a redacted thread root
* Two failing tests for counting correctly when a thread message was redacted
* Test for reading a thread containing an earlier redaction
* Failing tests for redacted messages in threads
* Expand a thread reply test to be more explicit
* Add an assertion that the thread is read after I read it
* Assert that the thread is unread after an edit
* Minor improvements to unread tests
* Test for reading an older message in a room
* Test for reading an old message in a thread
Also a mostly-trivial test for read status being preserved over
restarts.
* Give the reason for a failing test
* Fix a failing test by making it wait for a thread to be read
* More tests for thread roots
* Add a 'm.relates_to' to edits in receipt tests
* Disable a test that fails with real edits
* Wait for the room to be read after we mark it as read
* Skip tests that are failing because of inconsistencies between local and CI behaviour