Files
lazysecrets/internal/ui/app/status_test.go
T
kebandClaude Opus 5.5 46d6d37dc2
Release / Build and publish (push) Successful in 24s
Hello world 👋
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 10:29:42 +02:00

31 lines
915 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package app
import (
"testing"
"git.kebcloud.no/keb/lazysecrets/internal/ui/panes"
)
func TestChangelogFields(t *testing.T) {
t.Parallel()
md := "# Changelog\n\nEvery release of lazysecrets, newest first.\n\n## v0.2.0 – 2026-10-12\n\n### Added\n\n" +
"- Search ([#11](https://x/pulls/11)) ([65dc2d7](https://x/commit/65dc2d7))\n\n### Fixed\n\n- A fix (#3)\n\n" +
"## v0.1.0 – 2026-10-10\n\nHello world 👋\n\n<!-- generated by git-cliff (cliff.toml) -->\n"
got := changelogFields(md)
want := []panes.Field{
{Label: "v0.2.0", Value: "2026-10-12", Info: true},
{Value: "added: Search (#11) (65dc2d7)"},
{Value: "fixed: A fix (#3)"},
{Label: "v0.1.0", Value: "2026-10-10", Info: true},
{Value: "Hello world 👋"},
}
if len(got) != len(want) {
t.Fatalf("got %+v", got)
}
for i := range want {
if got[i] != want[i] {
t.Errorf("row %d: %+v, want %+v", i, got[i], want[i])
}
}
}