feat: translation codes
This commit is contained in:
@@ -30,7 +30,7 @@ it('sends a password reset email with a clickable api web url', function () {
|
||||
'email' => 'LEON@example.com',
|
||||
])
|
||||
->assertOk()
|
||||
->assertJsonPath('message', __('api.auth.password_reset_link_sent'));
|
||||
->assertJsonPath('code', 'PASSWORD_RESET_LINK_SENT');
|
||||
|
||||
Notification::assertSentTo(
|
||||
$user,
|
||||
@@ -99,7 +99,7 @@ it('does not reveal whether a reset email can be sent', function () {
|
||||
'email' => 'missing@example.com',
|
||||
])
|
||||
->assertOk()
|
||||
->assertJsonPath('message', __('api.auth.password_reset_link_sent'));
|
||||
->assertJsonPath('code', 'PASSWORD_RESET_LINK_SENT');
|
||||
|
||||
Notification::assertNothingSent();
|
||||
});
|
||||
@@ -121,7 +121,7 @@ it('resets the password and invalidates existing api tokens', function () {
|
||||
'token' => $token,
|
||||
])
|
||||
->assertOk()
|
||||
->assertJsonPath('message', __('api.auth.password_reset'));
|
||||
->assertJsonPath('code', 'PASSWORD_RESET');
|
||||
|
||||
expect(Hash::check('new-password', $user->fresh()->password))->toBeTrue();
|
||||
|
||||
@@ -208,7 +208,7 @@ it('rejects an invalid password reset token', function () {
|
||||
'token' => 'invalid-token',
|
||||
])
|
||||
->assertUnprocessable()
|
||||
->assertJsonPath('message', __('passwords.token'));
|
||||
->assertJsonPath('code', 'PASSWORD_RESET_FAILED');
|
||||
|
||||
expect(Hash::check('new-password', $user->fresh()->password))->toBeFalse();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user