Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
matrix-react-sdk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Matrix.org
matrix-react-sdk
Commits
7e0a62f8
Commit
7e0a62f8
authored
1 year ago
by
Andy Balaam
Browse files
Options
Downloads
Patches
Plain Diff
Make edits more realistic in receipt tests
parent
c7b0850f
Branches
andybalaam/fix-edits-in-receipt-tests
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cypress/e2e/read-receipts/high-level.spec.ts
+66
-13
66 additions, 13 deletions
cypress/e2e/read-receipts/high-level.spec.ts
with
66 additions
and
13 deletions
cypress/e2e/read-receipts/high-level.spec.ts
+
66
−
13
View file @
7e0a62f8
...
...
@@ -103,6 +103,11 @@ describe("Read receipts", () => {
});
}
function
backToThreadsList
()
{
cy
.
log
(
"
Back to threads list
"
);
cy
.
get
(
"
.mx_RightPanel
"
).
findByTitle
(
"
Threads
"
).
click
();
}
function
openThread
(
rootMessage
:
string
)
{
cy
.
log
(
"
Open thread
"
,
rootMessage
);
cy
.
get
(
"
.mx_RoomView_body
"
,
{
log
:
false
}).
within
(()
=>
{
...
...
@@ -191,6 +196,10 @@ describe("Read receipts", () => {
msgtype
:
content
.
msgtype
,
body
:
newMessage
,
},
"
m.relates_to
"
:
{
rel_type
:
"
m.replace
"
,
event_id
:
ev
.
getId
(),
},
};
}
})();
...
...
@@ -666,21 +675,34 @@ describe("Read receipts", () => {
});
it
.
skip
(
"
Reading a thread root within the thread view marks it as read in the main timeline
"
,
()
=>
{});
it
(
"
Creating a new thread based on a reply makes the room unread
"
,
()
=>
{
// Given a message and reply exist and are read
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
replyTo
(
"
Msg1
"
,
"
Reply1
"
),
threadedOff
(
"
Reply1
"
,
"
Resp1
"
)]);
assertUnread
(
room2
,
3
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
replyTo
(
"
Msg1
"
,
"
Reply1
"
)]);
goTo
(
room2
);
goTo
(
room1
);
assertRead
(
room2
);
// When I receive a thread message created on the reply
receiveMessages
(
room2
,
[
threadedOff
(
"
Reply1
"
,
"
Resp1
"
)]);
// Then the room is unread
assertUnread
(
room2
,
1
);
});
it
(
"
Reading a thread whose root is a reply makes the room read
"
,
()
=>
{
// Given an unread thread off a reply exists
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
replyTo
(
"
Msg1
"
,
"
Reply1
"
),
threadedOff
(
"
Reply1
"
,
"
Resp1
"
)]);
assertUnread
(
room2
,
3
);
goTo
(
room2
);
assertUnread
(
room2
,
1
);
assertUnreadThread
(
"
Reply1
"
);
// When I read the thread
openThread
(
"
Reply1
"
);
// Then the room and thread are read
assertRead
(
room2
);
assertReadThread
(
"
Reply1
"
);
});
});
});
...
...
@@ -821,36 +843,48 @@ describe("Read receipts", () => {
describe
(
"
in threads
"
,
()
=>
{
it
(
"
An edit of a threaded message makes the room unread
"
,
()
=>
{
// Given we have read the thread
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
)]);
assertUnread
(
room2
,
2
);
goTo
(
room2
);
openThread
(
"
Msg1
"
);
assertRead
(
room2
);
backToThreadsList
();
goTo
(
room1
);
// When a message inside it is edited
receiveMessages
(
room2
,
[
editOf
(
"
Resp1
"
,
"
Edit1
"
)]);
// Then the room and thread are unread
assertUnread
(
room2
,
1
);
goTo
(
room2
);
assertUnreadThread
(
"
Msg1
"
);
});
it
(
"
Reading an edit of a threaded message makes the room read
"
,
()
=>
{
// Given an edited thread message is making the room unread
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
)]);
assertUnread
(
room2
,
2
);
goTo
(
room2
);
openThread
(
"
Msg1
"
);
assertRead
(
room2
);
backToThreadsList
();
goTo
(
room1
);
receiveMessages
(
room2
,
[
editOf
(
"
Resp1
"
,
"
Edit1
"
)]);
assertUnread
(
room2
,
1
);
// When I read it
goTo
(
room2
);
openThread
(
"
Msg1
"
);
// Then the room and thread are read
assertRead
(
room2
);
assertReadThread
(
"
Msg1
"
);
});
it
(
"
Marking a room as read after an edit in a thread makes it read
"
,
()
=>
{
// XXX: fails because the room is still bold/dot even after marking as read
it
.
skip
(
"
Marking a room as read after an edit in a thread makes it read
"
,
()
=>
{
// Given an edit in a thread is making the room unread
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
),
editOf
(
"
Resp1
"
,
"
Edit1
"
)]);
assertUnread
(
room2
,
3
);
// TODO: the edit counts as a message!
...
...
@@ -876,39 +910,58 @@ describe("Read receipts", () => {
assertUnread
(
room2
,
1
);
// TODO: should this edit make us unread?
});
it
(
"
A room with an edited threaded message is still unread after restart
"
,
()
=>
{
// Given an edit in a thread is making a room unread
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
),
editOf
(
"
Resp1
"
,
"
Edit1
"
)]);
assertUnread
(
room2
,
3
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
)]);
markAsRead
(
room2
);
receiveMessages
(
room2
,
[
editOf
(
"
Resp1
"
,
"
Edit1
"
)]);
assertUnread
(
room2
,
1
);
// When I restart
saveAndReload
();
assertUnread
(
room2
,
3
);
// Then is it still unread
assertUnread
(
room2
,
1
);
});
it
(
"
A room where all threaded edits are read is still read after restart
"
,
()
=>
{
// XXX: fails for the same reason as "Marking a room as read after an edit in a thread makes it read"
it
.
skip
(
"
A room where all threaded edits are read is still read after restart
"
,
()
=>
{
// Given I have marked an edit in a thread as read
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
),
editOf
(
"
Resp1
"
,
"
Edit1
"
)]);
assertUnread
(
room2
,
3
);
markAsRead
(
room2
);
assertRead
(
room2
);
// When I restart
saveAndReload
();
// It is still read
assertRead
(
room2
);
});
});
describe
(
"
thread roots
"
,
()
=>
{
it
(
"
An edit of a thread root makes the room unread
"
,
()
=>
{
// Given I have read a thread
goTo
(
room1
);
receiveMessages
(
room2
,
[
"
Msg1
"
,
threadedOff
(
"
Msg1
"
,
"
Resp1
"
)]);
assertUnread
(
room2
,
2
);
goTo
(
room2
);
openThread
(
"
Msg1
"
);
backToThreadsList
();
assertRead
(
room2
);
goTo
(
room1
);
// When the thread root is edited
receiveMessages
(
room2
,
[
editOf
(
"
Msg1
"
,
"
Edit1
"
)]);
// Then the room is unread
assertUnread
(
room2
,
1
);
// But the thread is read
goTo
(
room2
);
assertRead
(
room2
);
assertReadThread
(
"
Edit1
"
);
});
it
.
skip
(
"
Reading an edit of a thread root makes the room read
"
,
()
=>
{
// Given a fully-read thread exists
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment