Added test cases for the Volunteer Dashboard page to the __tests__ module under the filename 'VolunteerDashboard.test.js' and 'VolunteerDashboardShelterCards.test.js'
Why was it changed?
To ensure with future code changes that the UI is still working properly.
How was it changed?
Added test cases to the aforementioned file.
Ensure 3 shelter cards are displayed without sign-up parts
Ensure that all the proper headers are displayed
Ensures that the buttons that navigate to shelters work
Ensures volunteer data rendered under Impact Created column
Important parts:
This function allows you to render the components that have nav links
function renderWithRouter(children, routes = []) {
const options = isValidElement(children) ? { element: children, path: "/" } : children;
Mocking shifts so server calls are not made since the component of the Upcoming Shifts function of Shifts.js isn't what is being tested with this component.
Fixes #96
What was changed?
Added test cases for the Volunteer Dashboard page to the __tests__ module under the filename 'VolunteerDashboard.test.js' and 'VolunteerDashboardShelterCards.test.js'
Why was it changed?
To ensure with future code changes that the UI is still working properly.
How was it changed?
Added test cases to the aforementioned file.
Important parts:
This function allows you to render the components that have nav links function renderWithRouter(children, routes = []) { const options = isValidElement(children) ? { element: children, path: "/" } : children;
const router = createMemoryRouter([{ ...options }, ...routes], { initialEntries: [options.path], initialIndex: 1, });
return render( );
}
Mocking shifts so server calls are not made since the component of the Upcoming Shifts function of Shifts.js isn't what is being tested with this component.