ucsb-cs156-s24 / proj-gauchoride-s24-5pm-6

https://ucsb-cs156-s24.github.io/proj-gauchoride-s24-5pm-6/
0 stars 0 forks source link

Anika - A dropdown in the Ride Assign Form with Availability ID, Driver Name, and Times #48

Closed amisra0 closed 5 months ago

amisra0 commented 5 months ago

I modified the Ride Assign Form to have a dropdown of each driver's availability with their name and ID so that someone assigning a Ride would not have to manually type in an ID and check what availability fits themselves, they instead have a list of all driver names and availabilities in front of them. Dokku deployment: https://proj-amisra0.dokku-14.cs.ucsb.edu/ This can be tested by having a driver, then navigating to Shifts, Availability to create Driver Availability image Then create a ride request under Ride Request -> Request Ride: image Then when pressing on "Assign Driver", it should navigate to a page where you can select which driver to assign to the ride from a dropdown menu that lists the driver ID, name, and availability: image   Closes #3 Testing Notes- Made sure to have correct testing and 100% coverage by first including a mock get request on drivers/all and driverAvailability/admin/all that returns mock data driverFixtures and driverAvailabilityFixturesSecond, I had to create a second Fixtures file because the original driverAvailabilityFixtures only had driverIDs 4, 5, and 6 whereas driverFixtures only had IDs 1, 2, and 3. Since these two attributes are crossreferenced in line 37 of RideAssignDriverForm.js to retrieve the full name of a driver. If they never match up then the name of a driver will always be undefined, signifying drivers that have not created their Availabilities, and that leads to the case of a driver name being defined never being tested, hence incomplete coverage. Adding the mock apis to testing as well as a driverAvailabilityFixturesSecond file with two drivers that have filled out their availabilities (IDs 1 and 2) and a third driver that has not filled out their availability (ID 6, not an existing ID in driverFixtures) leads to all cases being tested for the possibilities of dropdown options. Added test for "shiftId is required" by creating a select shift option and making sure error "is required" is printed in that case Added test for exact contents of each option to make sure that they couldn't be changed and still pass the test Had to change all the shiftId "3" to "2" since 3 is no longer an option in our testing, I now use 3 as the example where the driverId is not found (driverId is 6 and we only have drivers with IDs 1, 2, and 3)