summaryrefslogtreecommitdiff
path: root/internal/cli/tui_test.go
blob: 9d8f481e0227274db182a734a8d294841c03c7a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cli

import "testing"

func TestRootContainsTUISubcommand(t *testing.T) {
	cmd := NewRootCmd()

	found, _, err := cmd.Find([]string{"tui"})
	if err != nil {
		t.Fatalf("Find(tui) error = %v", err)
	}
	if found == nil {
		t.Fatal("Find(tui) returned nil command")
	}
	if found.Use != "tui" {
		t.Fatalf("found.Use = %q, want %q", found.Use, "tui")
	}
}

func TestNewTUICmdMetadata(t *testing.T) {
	cmd := newTUICmd()
	if cmd.Use != "tui" {
		t.Fatalf("Use = %q, want %q", cmd.Use, "tui")
	}
	if cmd.Short == "" {
		t.Fatal("Short description should not be empty")
	}
}