(t *testing.T)
| 34 | ) |
| 35 | |
| 36 | func TestOAuth2ProviderApps(t *testing.T) { |
| 37 | t.Parallel() |
| 38 | |
| 39 | // NOTE: Unit tests for OAuth2 provider app validation have been migrated to |
| 40 | // oauth2provider/provider_test.go for better separation of concerns. |
| 41 | // This test function now focuses on integration testing with the full server stack. |
| 42 | |
| 43 | t.Run("IntegrationFlow", func(t *testing.T) { |
| 44 | t.Parallel() |
| 45 | |
| 46 | client := coderdtest.New(t, nil) |
| 47 | _ = coderdtest.CreateFirstUser(t, client) |
| 48 | ctx := testutil.Context(t, testutil.WaitLong) |
| 49 | |
| 50 | // Test basic app creation and management in integration context |
| 51 | //nolint:gocritic // OAuth2 app management requires owner permission. |
| 52 | app, err := client.PostOAuth2ProviderApp(ctx, codersdk.PostOAuth2ProviderAppRequest{ |
| 53 | Name: fmt.Sprintf("integration-test-%d", time.Now().UnixNano()%1000000), |
| 54 | CallbackURL: "http://localhost:3000", |
| 55 | }) |
| 56 | require.NoError(t, err) |
| 57 | require.NotEmpty(t, app.ID) |
| 58 | require.NotEmpty(t, app.Name) |
| 59 | require.Equal(t, "http://localhost:3000", app.CallbackURL) |
| 60 | }) |
| 61 | } |
| 62 | |
| 63 | func TestOAuth2ProviderAppSecrets(t *testing.T) { |
| 64 | t.Parallel() |
nothing calls this directly
no test coverage detected