Image snapshot in Jest. Maybe convert the result canvas to an image and compare it to the previous snapshot.
Image snapshot in Cypress. This could be slow to run.
Sync elementsSnapshot from component's state to a global variable (window). Then, expect against the global variable. This can check if raw data for drawing is correct, but it's not cover the result of drawing.
Possible approaches
elementsSnapshot
from component's state to a global variable (window
). Then,expect
against the global variable. This can check if raw data for drawing is correct, but it's not cover the result of drawing.