(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestForm_ShiftTabCycling(t *testing.T) { |
| 31 | form := NewForm("Submit", |
| 32 | FormItem{Label: "First", Field: NewTextField("first")}, |
| 33 | FormItem{Label: "Second", Field: NewTextField("second")}, |
| 34 | ) |
| 35 | |
| 36 | formPressShiftTab(&form) |
| 37 | assert.Equal(t, 3, form.Focused(), "cancel button") |
| 38 | |
| 39 | formPressShiftTab(&form) |
| 40 | assert.Equal(t, 2, form.Focused(), "submit button") |
| 41 | |
| 42 | formPressShiftTab(&form) |
| 43 | assert.Equal(t, 1, form.Focused()) |
| 44 | |
| 45 | formPressShiftTab(&form) |
| 46 | assert.Equal(t, 0, form.Focused()) |
| 47 | } |
| 48 | |
| 49 | func TestForm_EnterAdvancesFocus(t *testing.T) { |
| 50 | form := NewForm("Submit", |
nothing calls this directly
no test coverage detected
searching dependent graphs…