I started using a nice NuGet package for doing integration tests - https://github.com/VerifyTests/Verify and received feedback such as :
it's not entirely fair to use the system under test response as expected instead of creating it manually.
In other words, I would be expected to
I want to mention here that we have multi-country scenarios with quite a few country specific flags, which is why this tool helps me have country agnostic tests in terms of code (and only the "expected" is country specific)
Basically this tool helps that after a test is written, on the first run it fails and suggests what the expected result should be - it assumes that what I am asserting is what I want as expected (which I was told is a bad practice to let the tested application "decide" what the expected should be).
In my tested application I deal with huge json files with lots of computed properties, which takes a lot of time to create from scratch.
On the first run of the test we get something like this, where on the left is what the system under test result is found and on the right we have to put the expected value (if the received result is correct, copy paste)
If the application result is correct (I validate every single property) and then I simply paste the received result in the "verified" file and from there on, the test will forever pass until the received values do not match the expected value.
Question: Is this type of snapshot testing a good practice or not?
Changed question as to be more on the point.
Question: Does this type of snapshot testing break any testing rules?
(Provided that when defining the test and getting the initial result from the application, we as testers actually check that result before making it the expected result)