summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg/gui/presentation/branches_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/gui/presentation/branches_test.go b/pkg/gui/presentation/branches_test.go
index ba79f16ce..14012cda2 100644
--- a/pkg/gui/presentation/branches_test.go
+++ b/pkg/gui/presentation/branches_test.go
@@ -44,6 +44,16 @@ func Test_getBranchDisplayStrings(t *testing.T) {
expected: []string{"1m", "branch_name"},
},
{
+ branch: &models.Branch{Name: "πŸ‰_special_char", Recency: "1m"},
+ itemOperation: types.ItemOperationNone,
+ fullDescription: false,
+ viewWidth: 19,
+ useIcons: false,
+ checkedOutByWorktree: false,
+ showDivergenceCfg: "none",
+ expected: []string{"1m", "πŸ‰_special_c…"}, // truncated, but shouldn't
+ },
+ {
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
itemOperation: types.ItemOperationNone,
fullDescription: false,
@@ -185,6 +195,16 @@ func Test_getBranchDisplayStrings(t *testing.T) {
expected: []string{"1m", "branch_na…"},
},
{
+ branch: &models.Branch{Name: "πŸ‰_special_char", Recency: "1m"},
+ itemOperation: types.ItemOperationNone,
+ fullDescription: false,
+ viewWidth: 18,
+ useIcons: false,
+ checkedOutByWorktree: false,
+ showDivergenceCfg: "none",
+ expected: []string{"1m", "πŸ‰_special_…"}, // truncated two runes too much
+ },
+ {
branch: &models.Branch{Name: "branch_name", Recency: "1m"},
itemOperation: types.ItemOperationNone,
fullDescription: false,