Skip to content

Commit

Permalink
All tests fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
cannycookie committed Aug 25, 2024
1 parent a22efa6 commit 2c29fd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion database/factories/EmailTemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function definition() {
'preheader' => $this->faker->sentence,
'subject' => $this->faker->sentence,
'title' => $this->faker->sentence,
'content' => new HtmlString("<p>".$this->faker->text."</p>"),
'content' => "<p>".$this->faker->text."</p>",
'logo' => config('filament-email-templates.logo'),
'created_at' => now(),
'updated_at' => now(),
Expand Down
7 changes: 4 additions & 3 deletions tests/MailableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
use Visualbuilder\EmailTemplates\Models\EmailTemplate;
use Visualbuilder\EmailTemplates\Tests\Models\User;

it('can replace tokens in user welcome email', function () {
it('can replace tokens in user registered email', function () {

EmailTemplate::factory()->create(
[
'key' => 'user-welcome',
Expand Down Expand Up @@ -47,14 +48,14 @@
<p>If you didn't request this password reset, no further action is needed. However if this has happened more than once in a short space of time, please let us know.</p>
<p>We'll never ask for your credentials over the phone or by email and you should never share your credentials</p>
<p>If you’re having trouble clicking the 'Change My Password' button, copy and paste the URL below into your web browser:</p>
<p><a href='##tokenURL##'>##tokenURL##</a></p>
<p><a href='##tokenUrl##'>##tokenUrl##</a></p>
<p>Kind Regards,<br>##config.app.name##</p>",
]
);

$this->makeTheme();
$user = User::factory()->create();
$token = Password::broker()->createToken($user);
$token = \Illuminate\Support\Facades\Password::broker()->createToken($user);
$tokenUrl = "https://yourwebsite.com/user/password/reset/$token";
$mailable = new UserRequestPasswordResetEmail($user, $tokenUrl);
$mailable->assertSeeInHtml("Hello $user->name,");
Expand Down

0 comments on commit 2c29fd9

Please sign in to comment.