aboutsummaryrefslogtreecommitdiff
path: root/menubar/panel.swift
diff options
context:
space:
mode:
Diffstat (limited to 'menubar/panel.swift')
-rw-r--r--menubar/panel.swift11
1 files changed, 11 insertions, 0 deletions
diff --git a/menubar/panel.swift b/menubar/panel.swift
index 5362d32..21b4644 100644
--- a/menubar/panel.swift
+++ b/menubar/panel.swift
@@ -718,6 +718,17 @@ func panelSelftest() -> [String] {
check(full.plainText.hasSuffix("[Show less ▴]") && !compact.plainText.contains("Show"),
"toggle offered only when allowed, labelled by layout")
+ // Spend.
+ check(dollars(0.42) == "$0.42" && dollars(19.849) == "$19.85" && dollars(99.994) == "$99.99"
+ && dollars(99.996) == "$100" && dollars(1967.14) == "$1,967", "spend: cents below $100, then whole dollars")
+ var spender = row("s", .done)
+ spender.cost = 19.85
+ check(spender.subtitle.hasPrefix("s · s · pi · $19.85 · done "), "spend: today's in the subtitle, before the wait")
+ spender.cost = 0.004
+ check(!spender.subtitle.contains("$"), "spend: nothing spent, nothing shown")
+ check(Spend(today: 8.86, week: 456.87, month: 8.86).line == "$8.86 today · $457 this week · $8.86 this month"
+ && Spend(today: 0, week: 0, month: 0).isEmpty, "spend: the menu's line")
+
// Forgotten drafts: a draft the user is not looking at.
var drafty = [row("d", .done), row("w", .working), row("i1", .idle), row("i2", .idle), row("i3", .idle)]
drafty[0].draft = "x"; drafty[1].draft = "x"; drafty[3].draft = "x"; drafty[4].draft = "x"