mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 23:50:48 +02:00
- Update .gitignore to include new provider files and ensure proper tracking. - Refactor job and config forms to support multiple configuration selections, improving user experience. - Implement logic to handle the initialization of skipProcessedFiles with a default value. - Add new provider form templates for better organization and management of source and destination configurations. - Enhance tests for provider forms and job configurations to ensure robust functionality. - Introduce nullable handling for skipProcessedFiles in the database schema and update related migrations. - Improve error handling and validation in job creation and editing processes.
30 lines
601 B
Go
30 lines
601 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHandleHome(t *testing.T) {
|
|
// Set up test environment
|
|
handlers, router := setupTestHandlers(t)
|
|
|
|
// Set up the route
|
|
router.GET("/", handlers.HandleHome)
|
|
|
|
// Create a test request
|
|
req := httptest.NewRequest("GET", "/", nil)
|
|
w := httptest.NewRecorder()
|
|
|
|
// Serve the request
|
|
router.ServeHTTP(w, req)
|
|
|
|
// Check response
|
|
assert.Equal(t, http.StatusOK, w.Code)
|
|
assert.Contains(t, w.Body.String(), "Home - GoMFT")
|
|
assert.Contains(t, w.Body.String(), "Welcome to GoMFT")
|
|
}
|