Files
fish03andClaude Opus 5.5 bef9f8b4ed Initial commit
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 14:43:16 +07:00

27 lines
774 B
Go

package web
import "testing"
func TestEmptyScopedPage(t *testing.T) {
tests := []struct {
name string
hasIdentifier bool
totalCount int64
itemCount int
want bool
}{
{name: "missing detail", hasIdentifier: true, want: true},
{name: "empty aggregate page", hasIdentifier: false, want: false},
{name: "has total", hasIdentifier: true, totalCount: 1, want: false},
{name: "has item", hasIdentifier: true, itemCount: 1, want: false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := emptyScopedPage(tt.hasIdentifier, tt.totalCount, tt.itemCount); got != tt.want {
t.Fatalf("emptyScopedPage(%v, %d, %d) = %v, want %v", tt.hasIdentifier, tt.totalCount, tt.itemCount, got, tt.want)
}
})
}
}