I am working on a Rails + React application and investigating frontend testing. Unlike the backend tests this doesn't seem to be a straightforward process with one obvious path. There are a list of possible ways to go about this and they all seem to test in very different ways.
The methods I have found are:
Importing the js files and running the functions inside and checking the return values. This seems like the simplest thing to do but very little of our js code simply takes values in and returns something so not much of the app could be tested this way
Using libraries like enzyme to simulate the react components rendering and simulating interaction. Also includes storing mocked responses that the server would send to load them in to the test
Running the entire backend and frontend and browser using something like selenium and automating the process of actually using the app in a real environment
I'm not very familiar with these libraries so its hard to tell where their limitations and strengths are but I have a list of requirements and example scenarios for what the tests should help with
These examples are:
Updating libraries like react/jquery and seeing if anything in the app broke. Selenium would probably work for this but I don't think the emulated component render libraries will because I don't think they actually import all the libraries like jquery when running a test
Updating an element and seeing if all the features of that element still work.
Most of the frontend bugs I have encountered result in something not working properly when you interact with it like a button not performing a function it should because jquery was updated. I can't see how anything but selenium could catch this. Are there other options I should be considering or more info about the ones I have listed that would make them do what I need?