Skip to content

Commit

Permalink
feat(tests): add tests for FinishedSignInEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed Jun 5, 2024
1 parent 4b007f4 commit 3efdc5b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/pytest/oauth/test_analytics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from benefits.oauth.analytics import OAuthEvent
from benefits.oauth.analytics import OAuthEvent, FinishedSignInEvent


@pytest.mark.django_db
Expand All @@ -22,3 +22,15 @@ def test_OAuthEvent_verifier_no_client_name_when_does_not_use_auth_verification(
event = OAuthEvent(app_request, "event type")

assert "auth_provider" not in event.event_properties


@pytest.mark.django_db
def test_FinishedSignInEvent_with_error(app_request):
event = FinishedSignInEvent(app_request, error=10)
assert event.event_properties["error_code"] == 10


@pytest.mark.django_db
def test_FinishedSignInEvent_without_error(app_request):
event = FinishedSignInEvent(app_request)
assert "error_code" not in event.event_properties

0 comments on commit 3efdc5b

Please sign in to comment.