@@ -44,3 +44,49 @@ func TestRecordingListPlainOutput(t *testing.T) {
4444 t .Fatalf ("golden mismatch:\n got: %q\n want: %q" , out , want )
4545 }
4646}
47+
48+ func TestRecordingPauseOutput (t * testing.T ) {
49+ // No t.Parallel(): these tests mutate the global cmdutil.VoiceClient.
50+ orig := cmdutil .VoiceClient
51+ t .Cleanup (func () { cmdutil .VoiceClient = orig })
52+ cmdutil .VoiceClient = func (string ) (api.Requester , string , error ) {
53+ return & testutil.FakeClient {}, "acct-123" , nil
54+ }
55+
56+ root := testutil .NewTestRoot (pauseCmd )
57+ root .SetArgs ([]string {"pause" , "c-abc123" })
58+
59+ out := testutil .CaptureStdout (t , func () {
60+ if err := root .Execute (); err != nil {
61+ t .Fatalf ("execute: %v" , err )
62+ }
63+ })
64+
65+ want := "Recording paused on call c-abc123.\n "
66+ if out != want {
67+ t .Fatalf ("golden mismatch:\n got: %q\n want: %q" , out , want )
68+ }
69+ }
70+
71+ func TestRecordingResumeOutput (t * testing.T ) {
72+ // No t.Parallel(): these tests mutate the global cmdutil.VoiceClient.
73+ orig := cmdutil .VoiceClient
74+ t .Cleanup (func () { cmdutil .VoiceClient = orig })
75+ cmdutil .VoiceClient = func (string ) (api.Requester , string , error ) {
76+ return & testutil.FakeClient {}, "acct-123" , nil
77+ }
78+
79+ root := testutil .NewTestRoot (resumeCmd )
80+ root .SetArgs ([]string {"resume" , "c-abc123" })
81+
82+ out := testutil .CaptureStdout (t , func () {
83+ if err := root .Execute (); err != nil {
84+ t .Fatalf ("execute: %v" , err )
85+ }
86+ })
87+
88+ want := "Recording resumed on call c-abc123.\n "
89+ if out != want {
90+ t .Fatalf ("golden mismatch:\n got: %q\n want: %q" , out , want )
91+ }
92+ }
0 commit comments