| 94 | } |
| 95 | |
| 96 | func TestRenderTabBranchWithActiveIndicator(t *testing.T) { |
| 97 | tb := &TabBar{} |
| 98 | |
| 99 | entry := TabEntry{ |
| 100 | Name: "auth", |
| 101 | Branch: "chief/auth", |
| 102 | LoopState: loop.LoopStateReady, |
| 103 | IsActive: true, |
| 104 | Total: 8, |
| 105 | Completed: 3, |
| 106 | } |
| 107 | |
| 108 | result := tb.renderTab(entry, 1) |
| 109 | if !strings.Contains(result, "[chief/auth]") { |
| 110 | t.Errorf("expected active tab to contain [chief/auth], got: %s", result) |
| 111 | } |
| 112 | if !strings.Contains(result, "◉") { |
| 113 | t.Errorf("expected active tab to contain active indicator, got: %s", result) |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | func TestRenderTabEmptyBranch(t *testing.T) { |
| 118 | tb := &TabBar{} |