matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.26k stars 252 forks source link

task(room_directory_search): add 'server' parameter to the room directory search #4188

Closed jmartinesp closed 1 week ago

jmartinesp commented 2 weeks ago

What the title says. This was previously missing.

Signed-off-by:

jmartinesp commented 2 weeks ago

I wanted to add some tests, but I'm not sure how to test this, to be honest 🫤 . Should I just add some mock response where I check the request contains the server parameter?

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.91%. Comparing base (70bcddf) to head (f961a57). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4188 +/- ## ========================================== + Coverage 84.89% 84.91% +0.02% ========================================== Files 272 272 Lines 29131 29133 +2 ========================================== + Hits 24730 24739 +9 + Misses 4401 4394 -7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bnjbvr commented 2 weeks ago

I wanted to add some tests, but I'm not sure how to test this, to be honest 🫤 . Should I just add some mock response where I check the request contains the server parameter?

You could, but it's strictly testing the behavior of Ruma, so it's not worth IMO. Feel free to call the server() function in one test, so we have basic coverage for it.