Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This test runs a snapshot test on all snippets in the database. After adjusting the test runtime (added more mocks) + fixing some old snippets, all 289 snippets now run without error.
So far, I excluded the test from the normal test suite, as I want to fire requests from the test suite.
Either this test could be ran manually from time to test a potential breaking change on a larger set of snippets. Or we run it by default on a database dump that can be updated from time to time.
At a certain point it will be too much work to maintain user snippets (and keep the test green) as more people start using strudel, but for now it seems like a good way to get more data to test on.
Function specific unit tests are of course still important, but it seems that running tests on real world examples brings out situations that a unit test does not come encounter.
Another related question is how to handle / communicate the privacy aspect of the snippet sharing function, as user data is stored in the supabase, and with this test that data is also processed. It could also be a legal issue to collect user data without having a gdpr compliant text on the website but I don't know much about these laws