@@ -156,7 +156,7 @@ public function testResetPasswordTokenEmptyValue()
156156 public function testResetPasswordTokenMismatched ()
157157 {
158158 $ this ->expectException (\Exception::class);
159- $ this ->expectExceptionMessage ('Cannot set the customer \' s password ' );
159+ $ this ->expectExceptionMessage ('The password token is mismatched. Reset and try again ' );
160160 $ query = <<<QUERY
161161mutation {
162162 resetPassword (
@@ -192,6 +192,52 @@ public function testNewPasswordEmptyValue()
192192 $ this ->graphQlMutation ($ query );
193193 }
194194
195+ /**
196+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
197+ *
198+ * @throws NoSuchEntityException
199+ * @throws Exception
200+ * @throws LocalizedException
201+ */
202+ public function testNewPasswordCheckMinLength ()
203+ {
204+ $ this ->expectException (\Exception::class);
205+ $ this ->expectExceptionMessage ('The password needs at least 8 characters. Create a new password and try again ' );
206+ $ query = <<<QUERY
207+ mutation {
208+ resetPassword (
209+ email: " {$ this ->getCustomerEmail ()}"
210+ resetPasswordToken: " {$ this ->getResetPasswordToken ()}"
211+ newPassword: "new_"
212+ )
213+ }
214+ QUERY ;
215+ $ this ->graphQlMutation ($ query );
216+ }
217+
218+ /**
219+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
220+ *
221+ * @throws NoSuchEntityException
222+ * @throws Exception
223+ * @throws LocalizedException
224+ */
225+ public function testNewPasswordCheckCharactersStrength ()
226+ {
227+ $ this ->expectException (\Exception::class);
228+ $ this ->expectExceptionMessage ('Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters. ' );
229+ $ query = <<<QUERY
230+ mutation {
231+ resetPassword (
232+ email: " {$ this ->getCustomerEmail ()}"
233+ resetPasswordToken: " {$ this ->getResetPasswordToken ()}"
234+ newPassword: "new_password"
235+ )
236+ }
237+ QUERY ;
238+ $ this ->graphQlMutation ($ query );
239+ }
240+
195241 /**
196242 * Check password reset for lock customer
197243 *
0 commit comments