package web_test import ( "context" "net/http" "net/http/httptest" "testing" "time" "github.com/stretchr/testify/require" ) // TestExpandReturnsSummaryBodyFragment: GET /v/{id}/expand returns the full // summary as an in-place card fragment (not a full page) — ADR-031. func TestExpandReturnsSummaryBodyFragment(t *testing.T) { ctx := context.Background() app := newApp(t) p := rawPool(t) resetDB(t, p) require.NoError(t, deliver(ctx, app, videoX, "the full summary text")) seedVideo(t, p, videoX, "X Title", "https://x", time.Time{}) html := body(t, do(t, app, httptest.NewRequest(http.MethodGet, "/v/"+videoX+"/expand", nil))) require.Contains(t, html, "the full summary text") require.Contains(t, html, "Takeaways") require.Contains(t, html, "highlight one") require.Contains(t, html, "card-expanded", "rendered as the expanded card") require.Contains(t, html, "/v/"+videoX+"/card", "carries a collapse affordance") require.NotContains(t, html, "