fix: simplify dashboard and disable unauthorized actions
hermetic-ci / test (push) Canceled after 0s
hermetic-ci / test (push) Canceled after 0s
This commit is contained in:
@@ -23,9 +23,8 @@ func TestCompleteModelWideOperationsConsoleShowsStableAvailableTargetDashboard(t
|
||||
|
||||
view := resizedModel(t, module, themeModeNoColor, 120, 36).View()
|
||||
assertUsableFrame(t, view, 120, 36,
|
||||
"proxyctl", "Active Profile: office",
|
||||
"● Enabled 1", "○ Disabled 1", "◇ External 1", "! Drifted 1",
|
||||
"> ● Enabled", "Shell", "State: ● Enabled", "Evidence: matches Active Profile",
|
||||
"proxyctl", "Profile: office",
|
||||
"> ● Enabled", "Shell", "matches Active Profile",
|
||||
)
|
||||
if strings.Contains(view, "APT") || strings.Contains(view, "apt-config was not detected") {
|
||||
t.Fatalf("default dashboard included an unavailable Target:\n%s", view)
|
||||
@@ -71,12 +70,8 @@ func TestCompleteModelDashboardRevealsUnavailableEvidenceAndStructuredDetails(t
|
||||
|
||||
view := model.View()
|
||||
assertUsableFrame(t, view, 120, 36,
|
||||
"> ○ Unavailable APT", "State: ○ Unavailable", "Evidence: apt-config was not detected",
|
||||
"Affects: package operations across privilege boundaries",
|
||||
"Permissions: pre-existing root write authority",
|
||||
"Ownership & restoration: isolated overlay; disabling reveals the", "previous configuration",
|
||||
"Restart risk: none", "Persistent package proxy.", "Longer APT explanation.",
|
||||
"u: hide unavailable",
|
||||
"> ○ Unavailable APT", "○ Unavailable", "apt-config was not detected",
|
||||
"Persistent package proxy.", "u: Hide unavailable",
|
||||
)
|
||||
if !(strings.Index(view, "Shell") < strings.Index(view, "APT") && strings.Index(view, "APT") < strings.Index(view, "Docker daemon")) {
|
||||
t.Fatalf("revealing unavailable Targets changed product order:\n%s", view)
|
||||
@@ -95,7 +90,7 @@ func TestCompleteModelNarrowDashboardFocusAndIndependentScrollingRetainTargetIde
|
||||
}
|
||||
}
|
||||
targets[22].Description.Summary = "Selected identity summary"
|
||||
targets[22].Description.Details = strings.Repeat("Scrollable detail line. ", 45) + "END OF TARGET DETAILS"
|
||||
targets[22].Evidence = strings.Repeat("Scrollable evidence line. ", 45) + "END OF TARGET EVIDENCE"
|
||||
module := &recordingModule{snapshot: app.Snapshot{ActiveProfile: "office", Targets: targets}}
|
||||
model := resizedModel(t, module, themeModeNoColor, 80, 24)
|
||||
for range 22 {
|
||||
@@ -103,7 +98,7 @@ func TestCompleteModelNarrowDashboardFocusAndIndependentScrollingRetainTargetIde
|
||||
}
|
||||
|
||||
view := model.View()
|
||||
assertUsableFrame(t, view, 80, 24, "> ○ Disabled Product Target 22", "Selected identity summary", "▶ Targets [focused]")
|
||||
assertUsableFrame(t, view, 80, 24, "> ○ Disabled Product Target 22", "▶ Targets [focused]")
|
||||
|
||||
model = updateKey(model, "tab")
|
||||
for range 70 {
|
||||
@@ -111,16 +106,16 @@ func TestCompleteModelNarrowDashboardFocusAndIndependentScrollingRetainTargetIde
|
||||
}
|
||||
view = model.View()
|
||||
assertUsableFrame(t, view, 80, 24,
|
||||
"> ○ Disabled Product Target 22", "▶ Target details [focused]", "END OF", "TARGET DETAILS",
|
||||
"↑/k ↓/j PgUp/PgDn: scroll", "Tab: focus Targets",
|
||||
"> ○ Disabled Product Target 22", "▶ Target details [focused]", "END OF", "TARGET EVIDENCE",
|
||||
"↑/↓: Scroll", "Tab: Targets",
|
||||
)
|
||||
|
||||
model = resize(model, 120, 36)
|
||||
view = model.View()
|
||||
assertUsableFrame(t, view, 120, 36, "> ○ Disabled Product Target 22", "END OF TARGET DETAILS", "▶ Target details [focused]")
|
||||
assertUsableFrame(t, view, 120, 36, "> ○ Disabled Product Target 22", "END OF TARGET", "EVIDENCE", "▶ Target details [focused]")
|
||||
if !sameLine(view, "Targets", "Target details") {
|
||||
t.Fatalf("resized dashboard did not become side by side:\n%s", view)
|
||||
}
|
||||
model = resize(model, 80, 24)
|
||||
assertUsableFrame(t, model.View(), 80, 24, "> ○ Disabled Product Target 22", "END OF", "TARGET DETAILS", "▶ Target details [focused]")
|
||||
assertUsableFrame(t, model.View(), 80, 24, "> ○ Disabled Product Target 22", "END OF", "TARGET EVIDENCE", "▶ Target details [focused]")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user