@@ -12,7 +12,9 @@ class Avo::UsersSystemTest < ApplicationSystemTestCase
1212
1313 user = create ( :user )
1414 user . enable_totp! ( ROTP ::Base32 . random_base32 , :ui_and_api )
15+ webauthn_credential = create ( :webauthn_credential , user :)
1516 user_attributes = user . attributes . with_indifferent_access
17+ webauthn_attributes = webauthn_credential . attributes . with_indifferent_access
1618
1719 visit avo . resources_user_path ( user )
1820
@@ -41,6 +43,7 @@ class Avo::UsersSystemTest < ApplicationSystemTestCase
4143 assert_not_equal user_attributes [ :encrypted_password ] , user . encrypted_password
4244 assert_nil user . totp_seed
4345 assert_empty user . mfa_hashed_recovery_codes
46+ assert_empty user . webauthn_credentials
4447
4548 audit = user . audits . sole
4649 event = user . events . where ( tag : Events ::UserEvent ::PASSWORD_CHANGED ) . sole
@@ -64,6 +67,10 @@ class Avo::UsersSystemTest < ApplicationSystemTestCase
6467 . except ( "mfa_level" , "updated_at" , "totp_seed" , "mfa_hashed_recovery_codes" , "encrypted_password" )
6568 . transform_values ( &:as_json )
6669 } ,
70+ "gid://gemcutter/WebauthnCredential/#{ webauthn_credential . id } " => {
71+ "changes" => webauthn_attributes . transform_values { [ it . as_json , nil ] } ,
72+ "unchanged" => { }
73+ } ,
6774 event . to_gid . as_json => {
6875 "changes" => event . attributes . transform_values { [ nil , it . as_json ] } ,
6976 "unchanged" => { }
0 commit comments