diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-26 22:59:16 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-26 22:59:16 +0200 |
| commit | dc7478d7dadf544787a9718608f11312bd2ea944 (patch) | |
| tree | dc445798ab132e08d8885672fcca0a37facd25ea /internal/tui/common/keys_test.go | |
| parent | 39a11ed5997a3829751dfbe4b666d3568d466276 (diff) | |
tui: revamp status keys and add pid/tid reselection flow
Diffstat (limited to 'internal/tui/common/keys_test.go')
| -rw-r--r-- | internal/tui/common/keys_test.go | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/internal/tui/common/keys_test.go b/internal/tui/common/keys_test.go index 3636107..42e47ab 100644 --- a/internal/tui/common/keys_test.go +++ b/internal/tui/common/keys_test.go @@ -10,14 +10,19 @@ func TestDefaultKeyMapIncludesDirGroupBinding(t *testing.T) { } probesHelp := keys.Probes.Help() - if probesHelp.Key != "p" || probesHelp.Desc != "probes" { + if probesHelp.Key != "o" || probesHelp.Desc != "probes" { t.Fatalf("unexpected probes binding help: key=%q desc=%q", probesHelp.Key, probesHelp.Desc) } selectHelp := keys.SelectPID.Help() - if selectHelp.Key != "s" || selectHelp.Desc != "select pid" { + if selectHelp.Key != "p" || selectHelp.Desc != "select pid" { t.Fatalf("unexpected select pid binding help: key=%q desc=%q", selectHelp.Key, selectHelp.Desc) } + + selectTIDHelp := keys.SelectTID.Help() + if selectTIDHelp.Key != "t" || selectTIDHelp.Desc != "select tid" { + t.Fatalf("unexpected select tid binding help: key=%q desc=%q", selectTIDHelp.Key, selectTIDHelp.Desc) + } } func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { @@ -42,7 +47,7 @@ func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { found = false for _, binding := range groups[1] { help := binding.Help() - if help.Key == "p" && help.Desc == "probes" { + if help.Key == "o" && help.Desc == "probes" { found = true break } @@ -54,7 +59,7 @@ func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { found = false for _, binding := range groups[1] { help := binding.Help() - if help.Key == "s" && help.Desc == "select pid" { + if help.Key == "p" && help.Desc == "select pid" { found = true break } @@ -62,20 +67,38 @@ func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { if !found { t.Fatalf("expected select pid binding in dashboard full help controls") } + + found = false + for _, binding := range groups[1] { + help := binding.Help() + if help.Key == "t" && help.Desc == "select tid" { + found = true + break + } + } + if !found { + t.Fatalf("expected select tid binding in dashboard full help controls") + } } -func TestDashboardShortHelpIncludesProbesBinding(t *testing.T) { +func TestDashboardStatusHelpIncludesProbesBinding(t *testing.T) { keys := DefaultKeyMap() - short := keys.DashboardShortHelp() + short := keys.DashboardStatusHelp() found := false + foundSelectTID := false for _, binding := range short { help := binding.Help() - if help.Key == "p" && help.Desc == "probes" { + if help.Key == "o" && help.Desc == "probes" { found = true - break + } + if help.Key == "t" && help.Desc == "select tid" { + foundSelectTID = true } } if !found { t.Fatalf("expected probes binding in dashboard short help") } + if !foundSelectTID { + t.Fatalf("expected select tid binding in dashboard short help") + } } |
