This topic is the discussion thread for the Vaadin documentation page Set Up Browserless Tests with Spring Boot | Vaadin.
Questions, feedback, and comments are welcome here.
This topic is the discussion thread for the Vaadin documentation page Set Up Browserless Tests with Spring Boot | Vaadin.
Questions, feedback, and comments are welcome here.
I'd like to test a component that doesn't carry a @Route annotation. This is a straightforward component that inherits from VerticalLayout. Its primary purpose is to be used flexibly wherever required. However, due to its intricate internal logic, thorough unit testing is essential.
While following this tutorial, I found myself being directed towards simulating a login process with a mock user, interacting with links, and more. This approach seems more in line with integration testing rather than unit testing.
I'm eager to test my Vaadin component in a pure, isolated environment, bypassing any login or authentication steps. Could the documentation provide insights or best practices on achieving this?
The components are package-protected, so that we can use them directly in the UIUnitTest.But nowhere on this page does it say that the test is in the same package as the view. Why are you making this assumption? In your starter projects, the tests are in a separate folder under `src`, as they should be.
The assumption is that you use the same Java package structure both in the main source folder and in the test source folder. So if your view is `src/main/java/my/app/MyView.java`, then your test is in `src/test/java/my/app/MyViewTest.java`.