extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.62k stars 573 forks source link

Add UI snapshot test for simple case #2368

Open cruessler opened 2 months ago

cruessler commented 2 months ago

This is a PR for a branch that I have been working on a couple of weeks ago. I did not want this to get lost, so I decided to open a PR, in particular because I discovered there were some open questions with respect to UI tests.

I think this works really well for cases where the program exits with an error message.

I found it quite challenging, though, when it comes to testing an application interactively because snapbox, the library that powers the snapshot test, isn’t designed for that use case. There’s potentially ways to work around that via environment variables or command line arguments, but before I go down that route, I first wanted to get your opinion on whether you think it’s worth putting more effort into this. I still think if we can get this to work, we’d have the option to write truly useful high-level regression tests of which I’m a big fan. What do you think? @extrawurst

2024-09-24: I’ll add more context and fix the failing test soon.