feat: the right pane describes what's selected in the pane you're in
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c8abc1dc95
commit
411068ba43
9 files changed
+232
-67
No files matched your search
@@ -185,8 +185,9 @@ func TestIcons(t *testing.T) {
|
||||
if !strings.Contains(screen, azure+" Azure") || !strings.Contains(screen, dbx+" Databricks") {
|
||||
t.Errorf("icons missing:\n%s", screen)
|
||||
}
|
||||
if !strings.Contains(screen, "source "+azure+" Azure / platform-prod") {
|
||||
t.Errorf("detail source line missing icon:\n%s", screen)
|
||||
d.keys("3")
|
||||
if !strings.Contains(d.screen(), "source "+azure+" Azure / platform-prod") {
|
||||
t.Errorf("detail source line missing icon:\n%s", d.screen())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,6 +401,7 @@ func (describing) Describe(_ context.Context, o provider.Object) (provider.Objec
|
||||
func TestDescribeUpdatesDetail(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t, describing{fake.Azure(0)})
|
||||
d.keys("3") // the fourth pane follows focus: the secret
|
||||
if !strings.Contains(d.screen(), "described db-password") {
|
||||
t.Fatalf("describe result not shown:\n%s", d.screen())
|
||||
}
|
||||
@@ -487,6 +489,7 @@ func TestVersions(t *testing.T) {
|
||||
func TestVersionHistoryInDetail(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t)
|
||||
d.keys("3") // the fourth pane follows focus: the secret
|
||||
screen := d.screen()
|
||||
for _, want := range []string{
|
||||
"versions 3 · v to browse",
|
||||
@@ -594,7 +597,7 @@ func TestPermissionErrorShownInPane(t *testing.T) {
|
||||
if !strings.Contains(d.screen(), "403 Forbidden") {
|
||||
t.Error("error not rendered")
|
||||
}
|
||||
if !strings.Contains(d.screen(), "Select a secret") {
|
||||
if !strings.Contains(d.screen(), "name kv-restricted") {
|
||||
t.Error("detail should show the container summary")
|
||||
}
|
||||
}
|
||||
@@ -1037,7 +1040,7 @@ func TestSignInMessageOnceThenInDetails(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriverOpts(t, Options{CollapseGroups: false}, fake.Azure(0), signedOut{fake.Azure(0)})
|
||||
hint := "Azure · admin: sign-in required"
|
||||
if !strings.Contains(lastLines(d.screen(), 2), hint) {
|
||||
if !strings.Contains(lastLines(d.screen(), 2), hint) { // the footer: one line
|
||||
t.Fatalf("not said at start:\n%s", d.screen())
|
||||
}
|
||||
d.keys("j")
|
||||
@@ -1050,7 +1053,7 @@ func TestSignInMessageOnceThenInDetails(t *testing.T) {
|
||||
if r, _ := d.m.sources.Selected(); r.provider != "Azure:admin@contoso.com/t1" {
|
||||
t.Fatalf("selected %+v", r)
|
||||
}
|
||||
if !strings.Contains(d.screen(), hint) || !strings.Contains(d.screen(), "press L to run az login --tenant t1") {
|
||||
if scr := d.screen(); !strings.Contains(scr, "problem") || !strings.Contains(scr, hint) || !strings.Contains(scr, "press L to run az login") {
|
||||
t.Errorf("not in Details:\n%s", d.screen())
|
||||
}
|
||||
if a := d.m.loginFor(); a == nil || a.Account != "Azure · admin" {
|
||||
@@ -1154,3 +1157,35 @@ func TestAccountPane(t *testing.T) {
|
||||
t.Errorf("back to %v, want Sources", d.m.focus)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetailsFollowFocus(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t)
|
||||
d.keys("3") // a secret
|
||||
if !strings.Contains(d.screen(), "version 3f9c2a") {
|
||||
t.Fatalf("secret not shown:\n%s", d.screen())
|
||||
}
|
||||
d.keys("2") // its vault
|
||||
if scr := d.screen(); !strings.Contains(scr, "name kv-app-prod") || strings.Contains(scr, "version 3f9c2a") {
|
||||
t.Errorf("vault not described:\n%s", scr)
|
||||
}
|
||||
d.keys("1") // its subscription
|
||||
if scr := d.screen(); !strings.Contains(scr, "name platform-prod") || !strings.Contains(scr, "vaults 3") {
|
||||
t.Errorf("subscription not described:\n%s", scr)
|
||||
}
|
||||
// Into the fourth pane: it keeps describing the subscription, and
|
||||
// shift+tab goes back there.
|
||||
d.keys("4")
|
||||
if !strings.Contains(d.screen(), "name platform-prod") {
|
||||
t.Errorf("lost the subscription:\n%s", d.screen())
|
||||
}
|
||||
d.keys("shift+tab")
|
||||
if d.m.focus != paneSources {
|
||||
t.Errorf("back to %v", d.m.focus)
|
||||
}
|
||||
// A value revealed from a left pane stays in view until hidden.
|
||||
d.keys("space")
|
||||
if !strings.Contains(d.screen(), "correct-horse-battery-staple") {
|
||||
t.Errorf("value not shown:\n%s", d.screen())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user