Validate providers and retain complete run debugging context
This commit is contained in:
@@ -48,8 +48,16 @@ func TestPipelineEditPickerHasTabNavigationFuzzySearchAndRetainedDraft(t *testin
|
||||
m.editorInput.SetValue("nv")
|
||||
updated, cmd := m.Update(tea.KeyMsg{Type: tea.KeyEnter})
|
||||
m = updated.(Model)
|
||||
if cmd == nil || m.editorOpen {
|
||||
t.Fatal("editor selection did not launch")
|
||||
if cmd != nil || m.editorOpen || m.mutationCommand == nil {
|
||||
t.Fatal("editor selection did not require confirmation")
|
||||
}
|
||||
if items, _ := draft.List(); len(items) != 0 {
|
||||
t.Fatal("draft created before approval")
|
||||
}
|
||||
updated, cmd = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'y'}})
|
||||
m = updated.(Model)
|
||||
if cmd == nil {
|
||||
t.Fatal("approved editor did not launch")
|
||||
}
|
||||
items, err := draft.List()
|
||||
if err != nil || len(items) != 1 || items[0].BaseVersion != 4 || items[0].Server != m.url {
|
||||
@@ -77,8 +85,13 @@ func TestNewPickerSupportsBothEditorsWithoutCreatingDraftOnCancel(t *testing.T)
|
||||
m.editorInput.SetValue(choice)
|
||||
updated, cmd := m.Update(tea.KeyMsg{Type: tea.KeyEnter})
|
||||
m = updated.(Model)
|
||||
if cmd == nil || m.editorOpen || m.confirmOpen || m.submitID != "" {
|
||||
t.Fatal("new choice did not launch editor or bypassed publication")
|
||||
if cmd != nil || m.editorOpen || m.mutationCommand == nil || m.confirmOpen || m.submitID != "" {
|
||||
t.Fatal("new choice did not require approval or bypassed publication")
|
||||
}
|
||||
updated, cmd = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'y'}})
|
||||
m = updated.(Model)
|
||||
if cmd == nil {
|
||||
t.Fatal("approved editor did not launch")
|
||||
}
|
||||
}
|
||||
items, err := draft.List()
|
||||
|
||||
Reference in New Issue
Block a user