class RatatuiRuby::Event::Sync

Synthetic event for synchronizing async operations in tests.

Testing async behavior is tricky. You inject an event, but results arrive later. By the time you assert, the async work may not have completed.

When a runtime (Tea, Kit) encounters this event, it should wait for all pending async operations to complete before processing the next event. This enables deterministic testing without changing production code paths.

Inject this event between user actions and assertions to ensure async results have been processed:

Example

inject_key("s")           # Triggers async command
inject_sync               # Wait for command to complete
inject_key(:q)            # Quit after seeing results
Tea.run(...)
assert_snapshots("after_s_with_results")

This is not ā€œtest modeā€ā€”it’s a real event that runtimes handle. Production apps could use it too (e.g., ā€œensure saves complete before quitā€).