| 8 | ) |
| 9 | |
| 10 | func TestRenderTabWithBranch(t *testing.T) { |
| 11 | tb := &TabBar{} |
| 12 | |
| 13 | entry := TabEntry{ |
| 14 | Name: "auth", |
| 15 | Branch: "chief/auth", |
| 16 | LoopState: loop.LoopStateRunning, |
| 17 | Iteration: 3, |
| 18 | Total: 8, |
| 19 | Completed: 3, |
| 20 | } |
| 21 | |
| 22 | result := tb.renderTab(entry, 1) |
| 23 | if !strings.Contains(result, "[chief/auth]") { |
| 24 | t.Errorf("expected tab to contain [chief/auth], got: %s", result) |
| 25 | } |
| 26 | if !strings.Contains(result, "auth") { |
| 27 | t.Errorf("expected tab to contain name 'auth', got: %s", result) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func TestRenderTabWithoutBranch(t *testing.T) { |
| 32 | tb := &TabBar{} |