tmbb / approval

Approval testing for Elixir
MIT License
1 stars 1 forks source link

Multiple Tests with Identical Input Overwriting the diff #1

Open mrdotb opened 1 month ago

mrdotb commented 1 month ago

Should the differences files name created using the output file name instead of input.

  2) test revg deals correctly with <tspan> elements inside a <text> element - function svg_to_png/3 (Resvg.Test)                                                                              
     test/resvg_test.exs:199                                                                                                                                                                   
     ** (Approval.ApprovalError) The following reference and snapshot don't match:                                                                                                             

           - test/support/text-font-change-reference.png                                                                                                                                       
           - test/support/snapshots/text-font-change_svg_to_png.png                                                                                                                            

         To see the differences, open the file "test/support/text-font-change-reference.png.diff.html".                                                                                        

     code: approve snapshot: File.read!(output),                                                                                                                                               
     stacktrace:
       test/resvg_test.exs:211: (test)

....

  3) test revg deals correctly with <tspan> elements inside a <text> element - function svg_string_to_png/3 (Resvg.Test)
     test/resvg_test.exs:158
     ** (Approval.ApprovalError) The following reference and snapshot don't match:

           - test/support/text-font-change-reference.png
           - test/support/snapshots/text-font-change_svg_string_to_png.png

         To see the differences, open the file "test/support/text-font-change-reference.png.diff.html".

     code: approve snapshot: File.read!(output),
     stacktrace:
       test/resvg_test.exs:172: (test)
tmbb commented 1 month ago

Should the differences files name created using the output file name instead of input.

Yes, I guess it makes more sense, because the snapshot is always unique but the reference doesn't need to be´. I'll update it.