Skip to content

Commit

Permalink
timeline: update test expectation after previous bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Jul 1, 2024
1 parent 00f3bb5 commit 97993e8
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions crates/matrix-sdk-ui/tests/integration/timeline/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ async fn test_edit_local_echo() {

assert!(timeline_stream.next().now_or_never().is_none());

// Set up the success response before editing, since edit causes an immediate
// retry (the room's send queue is not blocked, since the one event it couldn't
// send failed in an unrecoverable way).
drop(mounted_send);
Mock::given(method("PUT"))
.and(path_regex(r"^/_matrix/client/r0/rooms/.*/send/.*"))
.respond_with(ResponseTemplate::new(200).set_body_json(json!({ "event_id": "$1" })))
.expect(1)
.mount(&server)
.await;

// Let's edit the local echo.
let edit_info = item.edit_info().expect("getting the edit info for the local echo");

Expand All @@ -240,18 +251,6 @@ async fn test_edit_local_echo() {
let edit_message = item.content().as_message().unwrap();
assert_eq!(edit_message.body(), "hello, world");

// Now, reenable the send queue for that room, and observe the new event being
// sent.
drop(mounted_send);
Mock::given(method("PUT"))
.and(path_regex(r"^/_matrix/client/r0/rooms/.*/send/.*"))
.respond_with(ResponseTemplate::new(200).set_body_json(json!({ "event_id": "$1" })))
.expect(1)
.mount(&server)
.await;

room.send_queue().set_enabled(true);

// Observe the event being sent, and replacing the local echo.
assert_let!(Some(VectorDiff::Set { index: 1, value: item }) = timeline_stream.next().await);

Expand Down

0 comments on commit 97993e8

Please sign in to comment.