Skip to content

Commit

Permalink
Add test name text wrapping on small screens (#124)
Browse files Browse the repository at this point in the history
Co-authored-by: Amir Maleki <amirmal@systemgroup.net>
  • Loading branch information
thisisamirmaleki and Amir Maleki authored Aug 9, 2024
1 parent 16d4b9e commit 2d3f361
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/app/table_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ func shortenTestName(s string, trim bool, maxLength int) string {
ss := strings.Split(s, "/")
testName.WriteString(ss[0] + "\n")
for i, s := range ss[1:] {
testName.WriteString(" /" + s)
testName.WriteString(" /")
for len(s) > maxLength {
testName.WriteString(s[:maxLength-2] + " …\n ")
s = s[maxLength-2:]
}
testName.WriteString(s)
if i != len(ss[1:])-1 {
testName.WriteString("\n")
}
Expand Down

0 comments on commit 2d3f361

Please sign in to comment.