Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

describing about one of the test case #2

Open
surya-moorthy opened this issue Nov 3, 2024 · 3 comments
Open

describing about one of the test case #2

surya-moorthy opened this issue Nov 3, 2024 · 3 comments

Comments

@surya-moorthy
Copy link

surya-moorthy commented Nov 3, 2024

@hkirat bhai , in the following test case : test("User should not be able to delete a space created by another user", async () => { const response = await axios.post(${BACKEND_URL}/api/v1/space, { "name": "Test", "dimensions": "100x200", }, { headers: { authorization: Bearer ${userToken}`
}
})

    const deleteReponse = await axios.delete(`${BACKEND_URL}/api/v1/space/${response.data.spaceId}`, {
        headers: {
            authorization: `Bearer ${adminToken}`
        }
    })

   expect(deleteReponse.status).toBe(403)
})

` it says that user cannot able to delete the space the other user created , so in here why admin have to delete the space(and "admin cannot able to delete the user space" can be taken as seperate test case)

@surya-moorthy surya-moorthy changed the title describing about one of the issues. describing about one of the test case Nov 3, 2024
@surya-moorthy
Copy link
Author

surya-moorthy commented Nov 3, 2024

spaceId is unique ,so we check if the spaceId are matached then we can delete the space

@Ashu-Viron
Copy link

i think if certain user created spaces and not deleted it for long time then it will just incrz the storage so admin should able to delete spaces but it need's to have condition defined after certain period you can delete it or create any function that doesn't need userId to do this it is only accessible by admin so that they should delete that without violating user privacy

@neerajbachani
Copy link

To be precise, we could rename the current test to "No user (including admin) can delete another user's space" or split it into two cases would be clearer:

  1. Regular user cannot delete another user's space
  2. Admin cannot delete a user's space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants