Closed vceci closed 8 months ago
After trying the tests that were committed on this issue, I ran into a problem. The currentUserTest() throws an error when ran multiple times because the text that it is checking for with be displayed multiple times. Because there is more than one instance of the exercise text, the test fails. The solution to this problem is to have the exercise deleted after checking that it is there. However, this functionality is not yet implemented for the previous activity page. For now, the test will rely on the exercise being manually deleted from the database before every run. The test will be fixed once the feature of deleting exercises has been implemented.
Overview: The goal of this branch was to update the features of the first sprint to be user specific when using the app. When a user logs an exercise or goes to view their previous activity, they want to view only their data, so this branch makes sure that when an exercise is logged it goes to that specific users collection which is also the collection which is read from for the previous activity table.
Summary: The implementation of this feature was focused solely on the parts of our old code where it reads and writes to the database in Firestore. When referencing the collection that the function will interact with, it uses the name "exercises_" + currentUser. If this collection does not exist, it will make one. This ensures that the user that is currently logged in cannot see other users data unless they are friends, which also enhances user experience while using the app. There are a few other small changes in this pull request. It deletes unnecessary table rows in the fragment_prev_activity.xml and also deletes a redundant block of code in the FriendsFragment.java file. There is also testing included in the previous activity testing file to check that when an exercise is logged the user is able to see it in their previous activity table.