From 7ba9c5443df83628882b0fbd89518364517f6d8a Mon Sep 17 00:00:00 2001 From: piotmag769 Date: Wed, 4 Dec 2024 11:08:13 +0100 Subject: [PATCH] Fix test (fr) --- tests/e2e/support/mock_client.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/support/mock_client.rs b/tests/e2e/support/mock_client.rs index a502f8f..8dcb2a4 100644 --- a/tests/e2e/support/mock_client.rs +++ b/tests/e2e/support/mock_client.rs @@ -194,14 +194,15 @@ impl MockClient { Ok(message) } - /// Looks for a message that satisfies the given predicate in message trace or waits for a new - /// one. + /// Looks for a message that satisfies the given predicate in message trace and removes it from + /// it or waits for a new one. fn wait_for_message( &mut self, predicate: impl Fn(&Message) -> Option, ) -> Result { - for message in &self.trace { + for (index, message) in self.trace.iter().enumerate() { if let Some(ret) = predicate(message) { + self.trace.remove(index); return Ok(ret); } }