Remove test that steps and weights are honored correctly

Step and weight records may be presented in any order. Any test that
tries to enforce that one gets presented before teh other can't cannot
succeed. So, I've removed that test and instead put in a warning that
will appear when the view model gets loaded.
This commit is contained in:
Savanni D'Gerinel 2024-02-07 08:28:38 -05:00
parent 3db870d790
commit a8bf540517
1 changed files with 8 additions and 14 deletions

View File

@ -110,6 +110,14 @@ impl DayDetailViewModel {
.partition(|r| r.data.is_weight());
let (step_records, records): (Vec<Record<TraxRecord>>, Vec<Record<TraxRecord>>) =
records.into_iter().partition(|r| r.data.is_steps());
if weight_records.len() > 1 {
eprintln!("warning: multiple weight records found for {}. This is unsupported and the one presented is unpredictable.", date.format("%Y-%m-%d"));
}
if step_records.len() > 1 {
eprintln!("warning: multiple step records found for {}. This is unsupported and the one presented is unpredictable.", date.format("%Y-%m-%d"));
}
Ok(Self {
provider: Arc::new(provider),
date,
@ -454,20 +462,6 @@ mod test {
count: 2500,
}),
},
Record {
id: RecordId::default(),
data: TraxRecord::Weight(ft_core::Weight {
date: oct_13.clone(),
weight: 91. * si::KG,
}),
},
Record {
id: RecordId::default(),
data: TraxRecord::Steps(ft_core::Steps {
date: oct_13.clone(),
count: 2750,
}),
},
Record {
id: RecordId::default(),
data: TraxRecord::BikeRide(ft_core::TimeDistance {