Skip to content

Commit

Permalink
fix(test): duration was too close for tests
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Feb 22, 2024
1 parent 88007c0 commit fb9b5ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion crates/core/src/domain/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ impl ActivityEndOptions {
)]
#[getset(get = "pub")]
#[derive(Merge)]
#[serde(rename_all = "kebab-case")]
pub struct ActivityKindOptions {
#[serde(skip_serializing_if = "Option::is_none")]
parent_id: Option<ActivityGuid>,
}

Expand Down Expand Up @@ -324,7 +326,7 @@ mod tests {
begin = "2021-08-01T10:00:00"
duration = 50
kind = "intermission"
parent_id = "01F9Z4Z3Z3Z3Z4Z3Z3Z3Z3Z3Z4"
parent-id = "01F9Z4Z3Z3Z3Z4Z3Z3Z3Z3Z3Z4"
"#;

let activity: Activity = toml::from_str(toml).unwrap();
Expand Down
7 changes: 5 additions & 2 deletions crates/core/tests/activity_store.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Test the ActivityStore implementation with a InMemoryStorage backend.

use chrono::Local;
use chrono::{Local, NaiveDateTime};
use pace_core::{
Activity, ActivityFilter, ActivityGuid, ActivityLog, ActivityReadOps, ActivityStore,
ActivityWriteOps, BeginDateTime, InMemoryActivityStorage, TestResult,
Expand All @@ -17,7 +17,10 @@ fn activity_log_empty() -> ActivityLog {

#[fixture]
fn activity_log_with_variety_content() -> (Vec<Activity>, ActivityLog) {
let begin_time = BeginDateTime::default();
let begin_time = BeginDateTime::new(NaiveDateTime::new(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap().date(),
NaiveDateTime::from_timestamp_opt(0, 0).unwrap().time(),
));

let mut ended_activity = Activity::builder()
.description("Test Description".to_string())
Expand Down

0 comments on commit fb9b5ec

Please sign in to comment.