test: share the first-page and clock helpers

writeFirstPage answers paged listings in app and services tests,
testNow replaces the copied clock, withoutANSI the second color
stripper, and the single-entry table test becomes a plain test.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 14:25:38 +02:00
1 parent 83924892ff
commit dc24231ebc
23 files changed
+66 -105

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ func TestNotificationsListTheInboxByDefault(t *testing.T) {
}
deps, out, _ := serverDeps(t, server.URL)
deps.Streams.OutTTY, deps.Streams.Width = true, 100
deps.Now = func() time.Time { return time.Date(2026, 10, 11, 20, 0, 0, 0, time.UTC) }
deps.Now = func() time.Time { return testNow }
require.NoError(t, Execute(context.Background(), deps, []string{"notification", "list"}))
require.Equal(t, `Showing 2 of 2 unread or pinned notifications in your inbox