matt-dray / pixeltrix

:space_invader::computer_mouse: R package: make pixel art interactively in a plot window, get a matrix, make a gif
Other
21 stars 0 forks source link

How do you test the interactive elements? #27

Open matt-dray opened 1 year ago

matt-dray commented 1 year ago

frame_pixels() executes readline(), which requires user input to continue. In a non-interactive environment, e.g. a test, I think the response is encoded as "" . The two responses possible in frame_pixels are yes and no, however, so how can I test for these responses?

click_pixels() uses locator(); how does this behave in a non-interactive test? The output from the function is a plot, so that could be tested against, at least. It would have to be a blank plot, since no user-clicks will be registered in the non-interactive environment.