Thoroughly fill out the day detail view model along with proper automated testing #179

Merged
savanni merged 7 commits from fitnesstrax/improved-view-model into main 2024-02-07 15:08:50 +00:00
Owner

In this MR, the view model goes from being a hack job to a more structured system along with automated testing.

Resolves #172

In this MR, the view model goes from being a hack job to a more structured system along with automated testing. Resolves #172
savanni added 7 commits 2024-02-07 14:31:52 +00:00
c1e797f3ae DayDetailViewModel now ignores records and directly retrieves data from App
This is preparatory work. Having the view model directly retrieve data both adds a degree of symmetry (it both gets data from and sends data to the app) and makes it possible for the view model to refresh itself when needing to revert data or after saving data.
96317f5692 Finish removing the previous record grouping
Now that the DayDetailViewModel knows to retrieve its own records, the grouping functions, and passing groups of records around, no longer make sens.
24276d172b Introduce the RecordProvider interface
DayDetailViewModel needs testing. I've worked out an improved API, and a set of tests to go along with it, and those can be made more easily with a mockable RecordProvider. So, in addition to stubbing out a bunch of tests, I've also created RecordProvider, mocked it, and implemented it for App.
a8bf540517 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.
savanni merged commit 1d6155d9e5 into main 2024-02-07 15:08:50 +00:00
savanni deleted branch fitnesstrax/improved-view-model 2024-02-07 15:08:51 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: savanni/monorepo#179
No description provided.