Skip to content

Commit

Permalink
test: webauthn credentials counter
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 19, 2021
1 parent c3e1184 commit f7701f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions selfservice/strategy/webauthn/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package webauthn_test

import (
"fmt"
"github.com/ory/kratos/selfservice/strategy/webauthn"
"testing"

"github.com/ory/kratos/selfservice/strategy/lookup"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -15,7 +14,7 @@ import (

func TestCountActiveCredentials(t *testing.T) {
_, reg := internal.NewFastRegistryWithMocks(t)
strategy := lookup.NewStrategy(reg)
strategy := webauthn.NewStrategy(reg)

for k, tc := range []struct {
in identity.CredentialsCollection
Expand All @@ -31,15 +30,15 @@ func TestCountActiveCredentials(t *testing.T) {
{
in: identity.CredentialsCollection{{
Type: strategy.ID(),
Config: []byte(`{"lookup_url": ""}`),
Config: []byte(`{"credentials": []}`),
}},
expected: 0,
},
{
in: identity.CredentialsCollection{{
Type: strategy.ID(),
Identifiers: []string{"foo"},
Config: []byte(`{"lookup_url": ""}`),
Config: []byte(`{"credentials": [{}]}`),
}},
expected: 1,
},
Expand Down

0 comments on commit f7701f6

Please sign in to comment.