Skip to content

Beautiful Open-Source Form Builder

Update telemetry event tests to include new SSO_CREATED and TWO_FACTOR_ENABLED cases

JhumanJ381d8c490ea3
diff --git a/api/app/Http/Controllers/Settings/OidcConnectionController.php b/api/app/Http/Controllers/Settings/OidcConnectionController.php
index 3aff663b0..ae2c952ff 100644
--- a/api/app/Http/Controllers/Settings/OidcConnectionController.php
+++ b/api/app/Http/Controllers/Settings/OidcConnectionController.php
@@ -59,7 +59,7 @@ class OidcConnectionController extends Controller
}
$connection = IdentityConnection::create($data);
-
+
telemetry(TelemetryEvent::SSO_CREATED);
return response()->json($this->formatConnection($connection), 201);
diff --git a/api/tests/Unit/Service/Telemetry/TelemetryEventTest.php b/api/tests/Unit/Service/Telemetry/TelemetryEventTest.php
index c63cd8d10..42d351045 100644
--- a/api/tests/Unit/Service/Telemetry/TelemetryEventTest.php
+++ b/api/tests/Unit/Service/Telemetry/TelemetryEventTest.php
@@ -4,7 +4,7 @@ use App\Service\Telemetry\TelemetryEvent;
describe('TelemetryEvent', function () {
it('has all required event cases', function () {
- expect(TelemetryEvent::cases())->toHaveCount(6);
+ expect(TelemetryEvent::cases())->toHaveCount(8);
});
it('has INSTANCE_CREATED case with correct value', function () {
@@ -31,6 +31,14 @@ describe('TelemetryEvent', function () {
expect(TelemetryEvent::INSTANCE_PING->value)->toBe('instance.ping');
});
+ it('has TWO_FACTOR_ENABLED case with correct value', function () {
+ expect(TelemetryEvent::TWO_FACTOR_ENABLED->value)->toBe('two_factor.enabled');
+ });
+
+ it('has SSO_CREATED case with correct value', function () {
+ expect(TelemetryEvent::SSO_CREATED->value)->toBe('sso.created');
+ });
+
it('value method returns the enum value', function () {
expect(TelemetryEvent::INSTANCE_CREATED->value())->toBe('instance.created');
expect(TelemetryEvent::USER_CREATED->value())->toBe('user.created');