+// WhatsAppRetryTest runs WhatsApp without a model or network client call. All
+// timers and channels belong to its synctest bubble, so backoff uses fake time.
+type WhatsAppRetryTest struct {
+ whatsapp *WhatsApp
+ fake *WhatsAppFake
+ logs *SyncBuffer
+ loop *TurnLoop
+ events *TurnEventRecorder
+ cancel context.CancelFunc
+ done chan error
+}
+
+func (r *WhatsAppRetryTest) start(t *testing.T) {
+ t.Helper()
+
+ ctx, cancel := context.WithCancel(t.Context())
+ r.cancel = cancel
+ r.done = make(chan error, 1)
+ go func() {
+ r.done <- r.whatsapp.Run(ctx, r.loop, r.events.Add)
+ }()
+
+ t.Cleanup(func() {
+ cancel()
+ synctest.Wait()
+ })
+}
+