Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
fix tests and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkappa committed Mar 26, 2020
1 parent 6f8e82e commit 7bfeceb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## latest

* `management.ConnectionOptionsEmail`, `management.ConnectionOptionsSMS`: add `authParams`.

## v4.0.1

* `management.Tenant`: Add `use_scope_descriptions_for_consent` flag.

## v4.0.0

* **Breaking Change:** `Connection.Options` is now an `interface{}` accepting different types depending on the strategy.
15 changes: 7 additions & 8 deletions management/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ func TestConnection(t *testing.T) {
})

t.Run("Email", func(t *testing.T) {
name := fmt.Sprintf("Test-Connection-%d", time.Now().Unix())
name := fmt.Sprintf("Test-Connection-Email-%d", time.Now().Unix())
from := "{{application.name}} <test@example.com>"
subject := "Email Login - {{application.name}}"
syntax := "liquid"
body := "<html><body>email contents</body></html>"
scope := "openid profile"
g := &Connection{
e := &Connection{
Name: auth0.String(name),
Strategy: auth0.String("email"),
Options: &ConnectionOptionsEmail{
Expand All @@ -191,14 +191,14 @@ func TestConnection(t *testing.T) {
},
}

defer m.Connection.Delete(g.GetID())
defer m.Connection.Delete(e.GetID())

err := m.Connection.Create(g)
err := m.Connection.Create(e)
if err != nil {
t.Fatal(err)
}

o, ok := g.Options.(*ConnectionOptionsEmail)
o, ok := e.Options.(*ConnectionOptionsEmail)
if !ok {
t.Fatalf("unexpected type %T", o)
}
Expand All @@ -213,13 +213,12 @@ func TestConnection(t *testing.T) {
expect.Expect(t, o.GetBruteForceProtection(), true)
expect.Expect(t, o.GetDisableSignup(), true)
expect.Expect(t, o.GetName(), name)
expect.Expect(t, g.GetName(), name)

t.Logf("%s\n", g)
t.Logf("%s\n", e)
})

t.Run("SMS", func(t *testing.T) {
name := fmt.Sprintf("Test-Connection-%d", time.Now().Unix())
name := fmt.Sprintf("Test-Connection-SMS-%d", time.Now().Unix())
from := "+17777777777"
template := "Your verification code is { code }}"
syntax := "liquid"
Expand Down

0 comments on commit 7bfeceb

Please sign in to comment.