Skip to content

Commit

Permalink
test: add test for GetIdentityToUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Feb 20, 2022
1 parent e2a64d9 commit 5120ea3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions selfservice/flow/settings/strategy_helper_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package settings

import (
"github.com/ory/kratos/identity"
"github.com/ory/kratos/x"
"github.com/stretchr/testify/require"
"testing"
)

func TestGetIdentityToUpdate(t *testing.T) {
c := new(UpdateContext)
_, err := c.GetIdentityToUpdate()
require.Error(t, err)

expected := &identity.Identity{ID: x.NewUUID()}
c.UpdateIdentity(expected)

actual, err := c.GetIdentityToUpdate()
require.NoError(t, err)
require.Equal(t, expected, actual)
}

0 comments on commit 5120ea3

Please sign in to comment.