yao/openapi/tests/user/env_test.go
Max ca2344edb8 Refactor invitation handling and improve test coverage
- Updated invitation creation logic to support email invitations and customizable expiry durations.
- Enhanced tests for invitation creation, including scenarios for registered and unregistered users, and handling of missing email requirements.
- Refactored API endpoints to use consistent parameter naming for team IDs.
- Improved error handling and logging for invitation-related operations, ensuring clarity in failure cases.
- Added support for sending invitation emails through the messenger service, with appropriate templates and settings.
2025-10-08 16:16:49 +08:00

27 lines
964 B
Go

package user_test
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestEnvironmentVariables(t *testing.T) {
// Test that environment variables are available
signinClientID := os.Getenv("SIGNIN_CLIENT_ID")
signinClientSecret := os.Getenv("SIGNIN_CLIENT_SECRET")
t.Logf("SIGNIN_CLIENT_ID: %s (length: %d)", signinClientID, len(signinClientID))
t.Logf("SIGNIN_CLIENT_SECRET: %s (length: %d)", signinClientSecret, len(signinClientSecret))
// Skip this test if environment variables are not set
// This test is meant to verify the environment setup but doesn't affect functionality
if signinClientID == "" || signinClientSecret == "" {
t.Skip("Skipping environment variable test: SIGNIN_CLIENT_ID or SIGNIN_CLIENT_SECRET not set. " +
"This is expected in some test environments.")
}
// Check if client ID is exactly 32 characters
assert.Equal(t, 32, len(signinClientID), "SIGNIN_CLIENT_ID should be exactly 32 characters")
}