(t *testing.T)
| 386 | } |
| 387 | |
| 388 | func TestTextExternalEditorHidden(t *testing.T) { |
| 389 | field := NewText().ExternalEditor(false) |
| 390 | f := NewForm(NewGroup(field)) |
| 391 | f.Update(f.Init()) |
| 392 | |
| 393 | // Type Huh in the form. |
| 394 | f = typeText(f, text) |
| 395 | view := viewModel(f) |
| 396 | |
| 397 | if !strings.Contains(view, text) { |
| 398 | t.Log(pretty.Render(view)) |
| 399 | t.Error("Expected field to contain " + text) |
| 400 | } |
| 401 | |
| 402 | if strings.Contains(view, "ctrl+e open editor") { |
| 403 | t.Log(pretty.Render(view)) |
| 404 | t.Error("Expected field to contain help without ctrl+e.") |
| 405 | } |
| 406 | |
| 407 | if field.GetValue() != text { |
| 408 | t.Error("Expected field value to be " + text) |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | func TestConfirm(t *testing.T) { |
| 413 | field := NewConfirm().Title("Are you sure?") |
nothing calls this directly
no test coverage detected
searching dependent graphs…