Artemis
Artemis copied to clipboard
`Development`: Refactor isAtLeast occurrences in client and unify spy testing
Checklist
General
- [x] I tested all changes and their related features with all corresponding user types on a test server.
- [x] I chose a title conforming to the naming conventions for pull requests.
Client
- [x] I followed the coding and design guidelines and ensured that the layout is responsive.
Motivation and Context
#3742 refactored the client code such that exercise/course objects store the current access rights in the client. There were not used in some components.
Additionally GitHub was complaining about the checking of some spies in the client. These are fixed and unified in the code as well. (Point 11: https://docs.artemis.ase.in.tum.de/dev/guidelines/client-tests/)
Description
This PR refactores the last components to also use the exercise/course objects for the access rights. The occurrences using the Metis service (e.g. post-header.component) is intentionally left out.
For checking the spies, we use .toHaveBeenCalledOnce()/.toHaveBeenCalledTimes(...) instead of .toHaveBeenCalled() and .not.toHaveBeenCalled() instead of .toHaveBeenCalled(0). This is unified in this PR
Review Progress
Code Review
- [ ] Review 1
- [ ] Review 2