--- Content key handling ---
(t *testing.T)
| 148 | } |
| 149 | |
| 150 | // --- Init --- |
| 151 | |
| 152 | func TestMailViewInitFetchesBoxes(t *testing.T) { |
| 153 | v := newMailView(testVC()) |
| 154 | cmd := v.Init() |
| 155 | if cmd == nil { |
| 156 | t.Fatal("Init with no boxes should return a fetch command") |
| 157 | } |
| 158 | if !v.requests.loading { |
| 159 | t.Error("Init should set loading = true") |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | func TestMailViewInitRefetchesWhenBoxesLoaded(t *testing.T) { |
| 164 | v := newMailView(testVC()) |
| 165 | v.boxes = testBoxes() |
| 166 | v.boxIndex = 0 |
| 167 | cmd := v.Init() |
| 168 | if cmd == nil { |
| 169 | t.Fatal("Init with boxes should return a fetch command for current box") |
nothing calls this directly
no test coverage detected