From f08af8a0b43f8591a1a5db8c90d29366c4efab72 Mon Sep 17 00:00:00 2001 From: Ani Channarasappa Date: Mon, 8 Mar 2021 18:03:21 -0500 Subject: [PATCH] fix: truncated quantities --- internal/ui/component/watchlist/watchlist.go | 2 +- internal/ui/component/watchlist/watchlist_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/ui/component/watchlist/watchlist.go b/internal/ui/component/watchlist/watchlist.go index 601761c..30c8e9b 100644 --- a/internal/ui/component/watchlist/watchlist.go +++ b/internal/ui/component/watchlist/watchlist.go @@ -114,7 +114,7 @@ func buildCells(quote Quote, position Position, config c.Config, styles c.Styles cells = append( []grid.Cell{ {Text: textPositionExtendedLabels(position, styles), Width: 15, Align: grid.Right, VisibleMinWidth: widthMinTerm + 15}, - {Text: textPositionExtended(quote, position, styles), Width: 7, Align: grid.Right, VisibleMinWidth: widthMinTerm}, + {Text: textPositionExtended(quote, position, styles), Width: 10, Align: grid.Right, VisibleMinWidth: widthMinTerm}, }, cells..., ) diff --git a/internal/ui/component/watchlist/watchlist_test.go b/internal/ui/component/watchlist/watchlist_test.go index b5380ce..293c424 100644 --- a/internal/ui/component/watchlist/watchlist_test.go +++ b/internal/ui/component/watchlist/watchlist_test.go @@ -567,8 +567,8 @@ Google Inc. ↓ -32.02 (-1.35 }, } expected := strings.Join([]string{ - "PTON ● Quantity: 100.00 105.00 (0.00%) 100.00", - "Peloton Avg. Cost: 0.00 ↑ 55.00 (110.00%) ↑ 10.00 (10.00%)", + "PTON ● Quantity: 100.00 105.00 (0.00%) 100.00", + "Peloton Avg. Cost: 0.00 ↑ 55.00 (110.00%) ↑ 10.00 (10.00%)", }, "\n") Expect("\n" + removeFormatting(m.View())).To(Equal("\n" + expected)) }) @@ -597,7 +597,7 @@ Google Inc. ↓ -32.02 (-1.35 }, } expected := strings.Join([]string{ - "PTON ● 100.00", + "PTON ● 100.00", "Peloton ↑ 10.00 (10.00%)", }, "\n") Expect("\n" + removeFormatting(m.View())).To(Equal("\n" + expected))