77
88namespace Magento \ReCaptchaWebapiGraphQl \Test \Api ;
99
10+ use Exception ;
1011use Magento \Framework \Encryption \EncryptorInterface ;
1112use Magento \TestFramework \Fixture \Config ;
1213use Magento \Framework \App \ResourceConnection ;
@@ -29,6 +30,7 @@ class ReCaptchaV3ConfigTest extends GraphQlAbstract
2930 language_code
3031 failure_message
3132 forms
33+ theme
3234 }
3335}
3436QUERY ;
@@ -49,6 +51,7 @@ public function setUp(): void
4951 Config('recaptcha_frontend/type_recaptcha_v3/score_threshold ' , 0.75 ),
5052 Config('recaptcha_frontend/type_recaptcha_v3/position ' , 'bottomright ' ),
5153 Config('recaptcha_frontend/type_recaptcha_v3/lang ' , 'en ' ),
54+ Config('recaptcha_frontend/type_recaptcha_v3/theme ' , 'light ' ),
5255 Config('recaptcha_frontend/failure_messages/validation_failure_message ' , 'Test failure message ' ),
5356 Config('recaptcha_frontend/type_for/customer_login ' , 'recaptcha_v3 ' )
5457 ]
@@ -65,7 +68,8 @@ public function testQueryRecaptchaNoPublicKeyConfigured(): void
6568 'failure_message ' => 'Test failure message ' ,
6669 'forms ' => [
6770 'CUSTOMER_LOGIN '
68- ]
71+ ],
72+ 'theme ' => 'light '
6973 ]
7074 ],
7175 $ this ->graphQlQuery (self ::QUERY )
@@ -76,6 +80,7 @@ public function testQueryRecaptchaNoPublicKeyConfigured(): void
7680 Config('recaptcha_frontend/type_recaptcha_v3/score_threshold ' , 0.75 ),
7781 Config('recaptcha_frontend/type_recaptcha_v3/position ' , 'bottomright ' ),
7882 Config('recaptcha_frontend/type_recaptcha_v3/lang ' , 'en ' ),
83+ Config('recaptcha_frontend/type_recaptcha_v3/theme ' , 'light ' ),
7984 Config('recaptcha_frontend/failure_messages/validation_failure_message ' , 'Test failure message ' )
8085 ]
8186 public function testQueryRecaptchaNoFormsConfigured (): void
@@ -100,7 +105,8 @@ public function testQueryRecaptchaNoFormsConfigured(): void
100105 'badge_position ' => 'bottomright ' ,
101106 'language_code ' => 'en ' ,
102107 'failure_message ' => 'Test failure message ' ,
103- 'forms ' => []
108+ 'forms ' => [],
109+ 'theme ' => 'light '
104110 ]
105111 ],
106112 $ this ->graphQlQuery (self ::QUERY )
@@ -111,6 +117,7 @@ public function testQueryRecaptchaNoFormsConfigured(): void
111117 Config('recaptcha_frontend/type_recaptcha_v3/score_threshold ' , 0.75 ),
112118 Config('recaptcha_frontend/type_recaptcha_v3/position ' , 'bottomright ' ),
113119 Config('recaptcha_frontend/type_recaptcha_v3/lang ' , 'en ' ),
120+ Config('recaptcha_frontend/type_recaptcha_v3/theme ' , 'dark ' ),
114121 Config('recaptcha_frontend/failure_messages/validation_failure_message ' , 'Test failure message ' ),
115122 Config('recaptcha_frontend/type_for/customer_login ' , 'recaptcha_v3 ' )
116123 ]
@@ -138,7 +145,8 @@ public function testQueryRecaptchaConfigured(): void
138145 'failure_message ' => 'Test failure message ' ,
139146 'forms ' => [
140147 'CUSTOMER_LOGIN '
141- ]
148+ ],
149+ 'theme ' => 'dark '
142150 ]
143151 ],
144152 $ this ->graphQlQuery (self ::QUERY )
@@ -151,7 +159,7 @@ public function tearDown(): void
151159 $ resource = Bootstrap::getObjectManager ()->get (ResourceConnection::class);
152160 /** @var AdapterInterface $connection */
153161 $ connection = $ resource ->getConnection (ResourceConnection::DEFAULT_CONNECTION );
154-
162+
155163 $ connection ->delete (
156164 $ resource ->getTableName ('core_config_data ' )
157165 );
0 commit comments