Keep read receipts for the other person only, and let photos, voice, and files stay cached until they are actually replaced.
37 lines
741 B
Go
37 lines
741 B
Go
package store_test
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
|
|
"pargar/backend/internal/db"
|
|
"pargar/backend/internal/store"
|
|
)
|
|
|
|
func TestLearningOverviewSmoke(t *testing.T) {
|
|
dsn := os.Getenv("DATABASE_URL")
|
|
if dsn == "" {
|
|
dsn = "postgres://pargar:f479ad70f076f25594b73b767691be4b295901c4430ed208@localhost:5432/pargar?sslmode=disable"
|
|
}
|
|
ctx := context.Background()
|
|
pool, err := db.Connect(ctx, dsn)
|
|
if err != nil {
|
|
t.Skip("postgres unavailable:", err)
|
|
}
|
|
defer pool.Close()
|
|
st := store.New(pool)
|
|
o, err := st.LearningOverview(ctx)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if o == nil {
|
|
t.Fatal("nil overview")
|
|
}
|
|
students, _, err := st.ListStudentLearning(ctx, "", "", "xp", 10, 0)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
_ = students
|
|
}
|