OpenTree-Education / rhizone-lms

A learning management system focused on self-reflection.
https://rhi.zone
BSD 3-Clause Clear License
14 stars 7 forks source link

There needs to be a test for the DELETE /:assessmentId route #541

Closed behrooz-a closed 1 year ago

behrooz-a commented 1 year ago

Describe the Feature / Enhancement

There needs to be a test for the DELETE /assessments/:assessmentId route (from the router file), which currently does not exist. We need to test this route to ensure the code written for the test will behave as expected by the protocol we previously defined.

This issue continues the work from issue #515.

Additional Details and Resources

This route requires a URL parameter of assessmentId (the ID of a program assessment) and expects no body in the request. The response should be empty for a program facilitator if the delete was successful; the response should be an error for any other user attempting to delete an assessment.

Correct Project Selected

Labels

behrooz-a commented 1 year ago

EOD: The DELETE route has been defined in assessmentsRouter file. In that file, the function has been divided into two sections one for a program facilitator and one for other users. In that function, some other functions need to be called and some variables are required to be defined. Today, the relevant variables have been defined and tomorrow the required function needs to be defined and called to complete the DELETE route.

behrooz-a commented 1 year ago

EOD: The DELETE route has been defined for the program facilitator and it will send an empty response if the delete was successful. Tomorrow, I should work on any other user who wants to delete an assessment and the response should be an error (401). Another task that needs to be done is to test the whole code whether the DELETE route has been implemented correctly or not.