Files
flowsight/backend/internal/store/seed_test.go
T
asepharyana 8c184ccae1 feat: add Citations and WatchlistChat components, integrate with API
- Implemented Citations component to display citation data.
- Created WatchlistDrawer and ChatSidebar components for managing watchlists and AI chat functionality.
- Integrated API calls for watchlist management and chat interactions.
- Updated index.tsx to include new components in the main application layout.
- Added API client in lib/api.ts for structured API interactions.
- Developed Alerts, Dashboard, Portfolio, Routines, Screener, and Report pages with relevant data fetching and UI components.
- Introduced styles in tokens.css for consistent theming across the application.
- Configured TypeScript and Vite for project setup and development.
2026-09-15 12:36:48 +07:00

36 lines
804 B
Go

package store
import (
"testing"
)
// Seed loads the historical week; row counts must match the fixture manifest.
func TestSeed(t *testing.T) {
db, err := Open(t.TempDir() + "/seed.db")
if err != nil {
t.Fatal(err)
}
defer db.Close()
st, err := db.SeedFromDir("../../tests/fixtures", "demo")
if err != nil {
t.Fatal(err)
}
if st.Snapshots != 23 {
t.Fatalf("snapshots = %d, want 23", st.Snapshots)
}
if st.Watchlist != 2 {
t.Fatalf("watchlist = %d, want 2", st.Watchlist)
}
if got := db.SnapshotCount("daily"); got != 1 {
t.Fatalf("daily snapshots = %d, want 1", got)
}
// Idempotent re-seed.
st2, err := db.SeedFromDir("../../tests/fixtures", "demo")
if err != nil {
t.Fatal(err)
}
if st2.Snapshots != 0 {
t.Fatalf("re-seed snapshots = %d, want 0", st2.Snapshots)
}
}