Configure full Docker setup and confirm consequential actions
This commit is contained in:
@@ -81,3 +81,24 @@ func TestCtrlCRemainsGlobal(t *testing.T) {
|
||||
t.Fatal("Ctrl+C did not quit")
|
||||
}
|
||||
}
|
||||
|
||||
func TestQuitUsesCommandInsteadOfQ(t *testing.T) {
|
||||
for _, m := range []Model{New(context.Background(), ""), panelModel(t), runInspectionModel()} {
|
||||
_, cmd := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'q'}})
|
||||
if cmd != nil {
|
||||
t.Fatal("q must not quit")
|
||||
}
|
||||
if !slices.Contains(m.pageCommands(), ":quit") {
|
||||
t.Fatal("quit command missing")
|
||||
}
|
||||
m = press(m, ":")
|
||||
m = press(m, "quit")
|
||||
_, cmd = m.Update(tea.KeyMsg{Type: tea.KeyEnter})
|
||||
if cmd == nil {
|
||||
t.Fatal("quit command did not exit")
|
||||
}
|
||||
if _, ok := cmd().(tea.QuitMsg); !ok {
|
||||
t.Fatal("quit command did not return QuitMsg")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user