Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting a custom reference date for mock devices #13

Closed
1 task done
pauljohanneskraft opened this issue Sep 15, 2024 · 2 comments · Fixed by #14
Closed
1 task done

Allow setting a custom reference date for mock devices #13

pauljohanneskraft opened this issue Sep 15, 2024 · 2 comments · Fixed by #14
Assignees
Labels
enhancement New feature or request

Comments

@pauljohanneskraft
Copy link

pauljohanneskraft commented Sep 15, 2024

Problem

When using mock devices, measurements are currently always recorded with the date "Jun 5, 2024 - 12:33 PM" (or close to that). For UI-Tests (one example), one may want to choose this date in a custom way to ensure that the measurement is actually shown to the user (e.g. when usually filtering the data relative to the "current" date).

Solution

Allow to set a reference date as a parameter for all public mock functions that use dates internally. If there are multiple dates involved one may decide to simply set that date relative to the reference date rather than having many different dates as inputs.

Additional context

StanfordBDHG/ENGAGE-HF-iOS#92 (comment)

In the UITests, we decided to not test for the mock measurement to appear in the chart. The chart is filtering the data for measurements in the last three months, so that we do not show that measurement anymore. It would be great, if we could set up the mock data in a way to always have the mock data being "yesterday" (or similar) in relation to the date the test is executed.

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@Supereg
Copy link
Member

Supereg commented Sep 16, 2024

Would you mind checking out #14 and see if that resolves this issue?

@pauljohanneskraft
Copy link
Author

pauljohanneskraft commented Sep 16, 2024

Thank you very much for these changes! Unfortunately, it doesn't fix the problem for us yet. We currently use HealthMeasurements.loadMockWeightMeasurement and HealthMeasurements.loadMockBloodPressureMeasurement and for those two functions, we cannot specify any parameters.

You can find this usage here: https://github.com/StanfordBDHG/ENGAGE-HF-iOS/blob/7c1ff4637d2bc341a10d563b7cee9fc23489d239/ENGAGEHF/Dashboard/Dashboard.swift#L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants