Skip to content

Commit

Permalink
test(ui): Fix Notification test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Jun 19, 2023
1 parent 30b7c4b commit 0c85b17
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions crates/matrix-sdk-ui/tests/integration/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ async fn test_smoke_test_notification_api() -> anyhow::Result<()> {
"conn_id": "notifs",
"extensions": {
"e2ee": {
"enabled": true
"enabled": true,
},
"to_device": {
"enabled": true
}
}
"enabled": true,
},
},
},
respond with = {
"pos": "0"
Expand All @@ -44,9 +44,9 @@ async fn test_smoke_test_notification_api() -> anyhow::Result<()> {
"pos": "1",
"extensions": {
"to_device": {
"next_batch": "nb0"
}
}
"next_batch": "nb0",
},
},
},
};

Expand All @@ -59,39 +59,33 @@ async fn test_smoke_test_notification_api() -> anyhow::Result<()> {
"conn_id": "notifs",
"extensions": {
"to_device": {
"since": "nb0"
}
}
"since": "nb0",
},
},
},
respond with = {
"pos": "2",
"extensions": {
"to_device": {
"next_batch": "nb1"
}
}
"next_batch": "nb1",
},
},
},
};

// The to-device since token is passed from the previous request.
// The extensions haven't changed, so they're not updated (sticky parameters
// ftw)... in the first request. Then, the sliding sync instance will retry
// those requests, so it will include them again; as a matter of fact, the
// last request that we assert against will contain those.
// ftw).
sliding_sync_then_assert_request_and_fake_response! {
[server, notification_stream]
sync matches Some(Err(_)),
assert request = {
"conn_id": "notifs",
"extensions": {
"e2ee": {
"enabled": true,
},
"to_device": {
"enabled": true,
"since": "nb1"
}
}
"since": "nb1",
},
},
},
respond with = (code 400) {
"error": "foo",
Expand Down

0 comments on commit 0c85b17

Please sign in to comment.