1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
package webauthn
import (
"testing"
"github.com/duo-labs/webauthn/protocol"
)
func TestRegistration_FinishRegistrationFailure(t *testing.T) {
user := &defaultUser{
id: []byte("123"),
}
session := SessionData{
UserID: []byte("ABC"),
}
webauthn := &WebAuthn{}
credential, err := webauthn.FinishRegistration(user, session, nil)
if err == nil {
t.Errorf("FinishRegistration() error = nil, want %v", protocol.ErrBadRequest.Type)
}
if credential != nil {
t.Errorf("FinishRegistration() credential = %v, want nil", credential)
}
}
|