TestTopDownQueryBottomLayout verifies the specific properties of the top-down-query-bottom layout.
(t *testing.T)
| 397 | // TestTopDownQueryBottomLayout verifies the specific properties of the |
| 398 | // top-down-query-bottom layout. |
| 399 | func TestTopDownQueryBottomLayout(t *testing.T) { |
| 400 | state := New() |
| 401 | state.screen = NewDummyScreen() |
| 402 | |
| 403 | state.Filters().Add(filter.NewIgnoreCase()) |
| 404 | |
| 405 | layout, err := TopDownQueryBottomLayout(state) |
| 406 | require.NoError(t, err) |
| 407 | |
| 408 | require.Equal(t, AnchorBottom, layout.prompt.anchor, |
| 409 | "prompt should be anchored at bottom") |
| 410 | require.Equal(t, 1+extraOffset, layout.prompt.anchorOffset, |
| 411 | "prompt anchor offset should be 1+extraOffset") |
| 412 | require.Equal(t, AnchorTop, layout.list.anchor, |
| 413 | "list should be anchored at top") |
| 414 | require.Equal(t, 0, layout.list.anchorOffset, |
| 415 | "list anchor offset should be 0") |
| 416 | require.True(t, layout.list.sortTopDown, |
| 417 | "list should sort top-down") |
| 418 | require.True(t, layout.SortTopDown(), |
| 419 | "SortTopDown() should return true") |
| 420 | } |
| 421 | |
| 422 | // TestCursorStyle verifies that UserPrompt.cursorStyle returns the correct |
| 423 | // fg/bg attributes depending on QueryCursor and Query style configuration. |
nothing calls this directly
no test coverage detected
searching dependent graphs…