@@ -50,6 +50,40 @@ func TestErrorDisplay_ShowView(t *testing.T) {
5050 }
5151}
5252
53+ func TestErrorDisplay_MultiActionRenders (t * testing.T ) {
54+ t .Parallel ()
55+
56+ e := NewErrorDisplay ()
57+ e = e .Show (output.ErrorEvent {
58+ Title : "Port 4566 already in use" ,
59+ Summary : "LocalStack may already be running." ,
60+ Actions : []output.ErrorAction {
61+ {Label : "Stop existing emulator:" , Value : "lstk stop" },
62+ {Label : "Use another port in the configuration:" , Value : "/home/user/.config/lstk/config.toml" },
63+ },
64+ })
65+
66+ view := e .View (80 )
67+ if ! strings .Contains (view , "Port 4566 already in use" ) {
68+ t .Fatalf ("expected view to contain title, got: %q" , view )
69+ }
70+ if ! strings .Contains (view , "LocalStack may already be running." ) {
71+ t .Fatalf ("expected view to contain summary, got: %q" , view )
72+ }
73+ if ! strings .Contains (view , "Stop existing emulator:" ) {
74+ t .Fatalf ("expected view to contain first action label, got: %q" , view )
75+ }
76+ if ! strings .Contains (view , "lstk stop" ) {
77+ t .Fatalf ("expected view to contain first action value, got: %q" , view )
78+ }
79+ if ! strings .Contains (view , "Use another port in the configuration:" ) {
80+ t .Fatalf ("expected view to contain second action label, got: %q" , view )
81+ }
82+ if ! strings .Contains (view , "/home/user/.config/lstk/config.toml" ) {
83+ t .Fatalf ("expected view to contain second action value, got: %q" , view )
84+ }
85+ }
86+
5387func TestErrorDisplay_MinimalEvent (t * testing.T ) {
5488 t .Parallel ()
5589
0 commit comments