There are multiple types of testing. Some of the more common testing strategies are Unit and Integration testing.
Unit testing is the most common way of testing logic. The idea is to isolate all external deps and just make sure we got the logic right. This works really well for most of the use cases. It should be a practise that developers write unit tests for every feature they add.
This is a more interesting approach to testing. Where the entire stack is tested. Ideally a browser is stimulated and is made to go through the entire user flow along with different edge cases. So that we make sure the entire UI/backend/DB/Infra is in good shape.