Accessibility#153
Conversation
We could also add `.secure(true)` to all `MockMvc` calls. We would need to add the https config to the application-test.properties then. Since it makes our tests marginally faster and otherwise doesn't cost anything I prefer this solution.
This helps screen readers. Users on desktop can also hover over the icon to get a textual description of what the button does.
|
|
||
| @Test | ||
| void profileView__validUser__profileDisplayed() throws Exception { | ||
| Mockito.when(authService.getCurrentUser()).thenReturn(testUsers.get(0)); |
There was a problem hiding this comment.
This is a bit silly as we really don't need to mock the AuthService once we actually have working auth in tests.
If we don't mock the AuthService then the ApplicationContext can't be reused though.
But I think the @AutoConfigureMockMvc will change the ApplicationContext hash anyways, since it adds the MockMvc to the context.
My suggestion would be to move all the @SpringBootTest classes to this pattern.
|
For constants please use the Tools.java class. If you need to check for the profile there is an example is DonateService:125, no need for ProfileConstants class. |
If you insist on doing it that way that's fine but the way you coded this we can never run multiple profiles at the same time since your check for the production profile will fail in that case. |
|
What's the use case for running multiple profiles at the same time? |
I use it to quickly mix in predefined behavior during development, which I don't always want to have turned on.
I might go ahead and do it to get more familiar with the code base but I'm not sure when I'll find the time. 🤷 |
I plan to do this for all the icon only buttons.
I also added the test setup in this PR so I could write a test for my changes.