| 29 | } |
| 30 | |
| 31 | func TestRenderTabWithoutBranch(t *testing.T) { |
| 32 | tb := &TabBar{} |
| 33 | |
| 34 | entry := TabEntry{ |
| 35 | Name: "auth", |
| 36 | LoopState: loop.LoopStateReady, |
| 37 | Total: 8, |
| 38 | Completed: 3, |
| 39 | } |
| 40 | |
| 41 | result := tb.renderTab(entry, 1) |
| 42 | // Should not contain a branch bracket like [chief/auth], but may contain [3/8] progress |
| 43 | if strings.Contains(result, "[chief/") { |
| 44 | t.Errorf("expected tab without branch to not contain branch brackets, got: %s", result) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func TestRenderTabBranchTruncation(t *testing.T) { |
| 49 | tb := &TabBar{} |