Skip to content

Commit

Permalink
chore: update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Nov 26, 2024
1 parent b727a3f commit 838ad84
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
13 changes: 5 additions & 8 deletions pkg/config/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ func newWithDefaults() auth {
Email: email{
EnableConfirmations: true,
},
Sms: sms{
TestOTP: map[string]string{},
},
}
}

Expand Down Expand Up @@ -563,9 +566,7 @@ func TestSmsDiff(t *testing.T) {
// This is not a valid config because platform requires a SMS provider.
// For consistency, we handle this in config.Load and emit a warning.
c := newWithDefaults()
c.Sms = sms{
EnableSignup: true,
}
c.Sms.EnableSignup = true
// Run test
diff, err := c.DiffWithRemote("", v1API.AuthConfigResponse{
ExternalPhoneEnabled: cast.Ptr(false),
Expand All @@ -578,11 +579,7 @@ func TestSmsDiff(t *testing.T) {

t.Run("enable provider without sign up", func(t *testing.T) {
c := newWithDefaults()
c.Sms = sms{
Messagebird: messagebirdConfig{
Enabled: true,
},
}
c.Sms.Messagebird.Enabled = true
// Run test
diff, err := c.DiffWithRemote("", v1API.AuthConfigResponse{
ExternalPhoneEnabled: cast.Ptr(false),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff remote[auth] local[auth]
--- remote[auth]
+++ local[auth]
@@ -88,7 +88,7 @@
@@ -89,7 +89,7 @@

[external]
[external.apple]
Expand All @@ -10,7 +10,7 @@ diff remote[auth] local[auth]
client_id = "test-client-1,test-client-2"
secret = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"
url = ""
@@ -144,7 +144,7 @@
@@ -145,7 +145,7 @@
redirect_uri = ""
skip_nonce_check = false
[external.google]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ diff remote[auth] local[auth]
account_sid = ""
message_service_sid = ""
auth_token = ""
@@ -85,9 +85,6 @@
from = ""
@@ -86,8 +86,6 @@
api_key = ""
api_secret = ""
-[sms.test_otp]
[sms.test_otp]
-123 = "456"
-456 = "123"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ diff remote[auth] local[auth]
[sms.textlocal]
enabled = false
sender = ""
@@ -85,6 +85,8 @@
from = ""
@@ -86,6 +86,7 @@
api_key = ""
api_secret = ""
+[sms.test_otp]
[sms.test_otp]
+123 = "456"

[third_party]
Expand Down

0 comments on commit 838ad84

Please sign in to comment.