(t *testing.T)
| 1129 | } |
| 1130 | |
| 1131 | func TestModel_LessScrolling(t *testing.T) { |
| 1132 | m := newTestModel() |
| 1133 | |
| 1134 | // Create a showLessMsg with many lines |
| 1135 | lines := make([]string, 100) |
| 1136 | for i := range 100 { |
| 1137 | lines[i] = fmt.Sprintf("Line %d: content", i+1) |
| 1138 | } |
| 1139 | content := strings.Join(lines, "\n") |
| 1140 | |
| 1141 | result, _ := m.Update(showLessMsg{content: content, title: "Test"}) |
| 1142 | m = result.(model) |
| 1143 | |
| 1144 | if m.overlay != overlayLess { |
| 1145 | t.Fatalf("expected overlayLess, got %d", m.overlay) |
| 1146 | } |
| 1147 | |
| 1148 | v1 := m.View() |
| 1149 | |
| 1150 | // Scroll down with 'j' |
| 1151 | result, _ = m.Update(tea.KeyPressMsg{Code: 'j'}) |
| 1152 | m = result.(model) |
| 1153 | result, _ = m.Update(tea.KeyPressMsg{Code: 'j'}) |
| 1154 | m = result.(model) |
| 1155 | result, _ = m.Update(tea.KeyPressMsg{Code: 'j'}) |
| 1156 | m = result.(model) |
| 1157 | |
| 1158 | v2 := m.View() |
| 1159 | |
| 1160 | if v1.Content == v2.Content { |
| 1161 | t.Fatal("expected view to change after scrolling in less overlay") |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | func TestModel_ResizeWithOverlay(t *testing.T) { |
| 1166 | m := newTestModel() |
nothing calls this directly
no test coverage detected