Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-kie committed Dec 31, 2024
1 parent 639beef commit ceb2b8c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/view/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ impl App for ViewManager {
}
}


#[cfg(test)]
mod tests {
use super::*;
use crate::components::{application::tests::{MockBluetooth}, measurement::MeasurementData};
use crate::components::{application::tests::MockBluetooth, measurement::MeasurementData};

fn setup_test_manager() -> (ViewManager, Sender<ViewState>) {
let (v_tx, v_rx) = tokio::sync::broadcast::channel(1);
Expand All @@ -201,13 +200,13 @@ mod tests {
async fn test_view_manager_state_switch() {
let (manager, v_tx) = setup_test_manager();
v_tx.send(ViewState::Acquisition((
Arc::new(RwLock::new(MeasurementData::default())) as ModelHandle<dyn MeasurementModelApi>,
Arc::new(RwLock::new(MeasurementData::default()))
as ModelHandle<dyn MeasurementModelApi>,
Arc::new(RwLock::new(MockBluetooth::new())) as ModelHandle<dyn BluetoothModelApi>,
)))
.unwrap();
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
let view = manager.active_view.read().await;
assert!(matches!(&*view, View::Acquisition(_)));
}

}
}

0 comments on commit ceb2b8c

Please sign in to comment.