package handlers_test import ( "net/http" "net/http/httptest" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "sneak.berlin/go/upaas/internal/service/app" ) // TestDashboardTableFitsCard checks that the card around the app table // scrolls sideways instead of hiding what does not fit, and that a long // repository URL wraps instead of pushing the action buttons out. func TestDashboardTableFitsCard(t *testing.T) { t.Parallel() testCtx := setupTestHandlers(t) repoURL := "https://git.example.com/user/" + "a-repository-name-long-enough-to-push-the-action-buttons-out.git" _, err := testCtx.appSvc.CreateApp(t.Context(), app.CreateAppInput{ Name: "long-url-app", RepoURL: repoURL, }) require.NoError(t, err) request := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/", nil) recorder := httptest.NewRecorder() testCtx.handlers.HandleDashboard().ServeHTTP(recorder, request) require.Equal(t, http.StatusOK, recorder.Code) body := recorder.Body.String() beforeTable, _, found := strings.Cut(body, `