Paginate briefing cards and add video previews

This commit is contained in:
2026-05-25 15:27:34 -04:00
parent e3453de788
commit 3eb74a9083
6 changed files with 277 additions and 41 deletions

View File

@@ -7,13 +7,13 @@ import (
func TestCoverageCRUD(t *testing.T) {
s := openTestStore(t)
// Verify schema migration version is 4 (since we added 004_coverage.sql)
// Verify schema migration version is 5 (since we added 005_news_enriched.sql)
version, err := s.SchemaVersion()
if err != nil {
t.Fatalf("SchemaVersion() error = %v", err)
}
if version != 4 {
t.Fatalf("SchemaVersion() = %d, want 4", version)
if version != 5 {
t.Fatalf("SchemaVersion() = %d, want 5", version)
}
// Verify session_coverage table exists

View File

@@ -28,8 +28,8 @@ func TestOpenAppliesMigrations(t *testing.T) {
if err != nil {
t.Fatalf("SchemaVersion() error = %v", err)
}
if version != 4 {
t.Fatalf("SchemaVersion() = %d, want 4", version)
if version != 5 {
t.Fatalf("SchemaVersion() = %d, want 5", version)
}
tables := []string{
@@ -99,6 +99,12 @@ func TestMigrationsAreIdempotent(t *testing.T) {
if count != 1 {
t.Fatalf("schema_migrations v4 count = %d, want 1", count)
}
if err := s.db.QueryRow(`SELECT COUNT(*) FROM schema_migrations WHERE version = 5`).Scan(&count); err != nil {
t.Fatalf("count schema_migrations v5: %v", err)
}
if count != 1 {
t.Fatalf("schema_migrations v5 count = %d, want 1", count)
}
}
func TestRawPayloadInsertAndRead(t *testing.T) {