From bee26c65c9511af82b9ed2051ab4f45b9570602d Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 21 Mar 2022 17:57:28 +0100 Subject: [PATCH] fix: unstable ordering --- selfservice/flow/login/sort.go | 2 +- selfservice/strategy/webauthn/login_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/selfservice/flow/login/sort.go b/selfservice/flow/login/sort.go index e1c22357841e..5724da3a6830 100644 --- a/selfservice/flow/login/sort.go +++ b/selfservice/flow/login/sort.go @@ -17,7 +17,7 @@ func sortNodes(ctx context.Context, n node.Nodes) error { node.LookupGroup, }), node.SortUseOrder([]string{ - "password_identifier", + "identifier", "password", }), ) diff --git a/selfservice/strategy/webauthn/login_test.go b/selfservice/strategy/webauthn/login_test.go index 87ecba6efc98..38369c313471 100644 --- a/selfservice/strategy/webauthn/login_test.go +++ b/selfservice/strategy/webauthn/login_test.go @@ -5,6 +5,7 @@ import ( _ "embed" "encoding/json" "fmt" + "github.com/ory/x/jsonx" "io" "net/http" "net/url" @@ -458,7 +459,7 @@ func TestCompleteLogin(t *testing.T) { apiClient := testhelpers.NewHTTPClientWithIdentitySessionToken(t, reg, id) f := testhelpers.InitializeLoginFlowViaBrowser(t, apiClient, publicTS, false, true, testhelpers.InitFlowWithAAL(identity.AuthenticatorAssuranceLevel2)) - assert.Equal(t, gjson.GetBytes(id.Traits, "subject").String(), f.Ui.Nodes[0].Attributes.UiNodeInputAttributes.Value) + assert.Equal(t, gjson.GetBytes(id.Traits, "subject").String(), f.Ui.Nodes[0].Attributes.UiNodeInputAttributes.Value, jsonx.TestMarshalJSONString(t, f.Ui)) testhelpers.SnapshotTExcept(t, f.Ui.Nodes, []string{ "0.attributes.value", "1.attributes.value",