[client] Display QR code for device auth login URL (#5415)

This commit is contained in:
JungwooShin
2026-05-04 18:59:29 +02:00
committed by GitHub
parent bde632c3b2
commit 104990dfdd
6 changed files with 73 additions and 3 deletions
+26
View File
@@ -0,0 +1,26 @@
package cmd
import (
"bytes"
"testing"
)
func TestPrintQRCode_EmptyURL(t *testing.T) {
var buf bytes.Buffer
printQRCode(&buf, "")
if buf.Len() != 0 {
t.Error("expected no output for empty URL")
}
}
func TestPrintQRCode_WritesOutput(t *testing.T) {
var buf bytes.Buffer
printQRCode(&buf, "https://example.com/auth")
if buf.Len() == 0 {
t.Error("expected QR code output for non-empty URL")
}
}