Files
libra/tests/Feature/Mail/WorkshopRegistrationMailTest.php
Naser Mansour 690c22395f Replace logo with client-supplied artwork; add Nablus workshop registration form
- public/images/logo.png replaced with the client's professionally-designed
  version, cropped to remove excess background margin (used sitewide via
  logo.blade.php / app-logo.blade.php / app-logo-icon.blade.php)
- New standalone, unlinked registration form at /forms/nablus-workshop for a
  one-off workshop Libra is co-hosting with Smart Business Center, replicating
  a ClickUp form the client previously used but with Libra's own branding.
  Submissions email info@libra.adv.ps and redirect to /about. No nav/footer
  link, no DB storage, no captcha (PRD v1.3).
- Tasks 17 (parent), 17-1 (Mailable + email template), 17-2 (page/route/form)
  taken through product-definition -> task-readiness -> dev-implement -> dev-qa,
  all Done. 11 new tests passing; full suite run clean of new regressions
  (69 pre-existing unrelated failures, documented in docs/tasks/17.md).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-27 23:56:50 +03:00

48 lines
1.5 KiB
PHP

<?php
use App\Mail\WorkshopRegistrationMail;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Mail;
test('workshop registration email implements ShouldQueue', function () {
expect(WorkshopRegistrationMail::class)->toImplement(ShouldQueue::class);
});
test('workshop registration email has correct arabic subject', function () {
$mailable = new WorkshopRegistrationMail('Test Name', '0599123456', null);
expect($mailable->envelope()->subject)
->toBe('تسجيل جديد - ورشة عمل ريادايات نابلس');
});
test('workshop registration email renders full name and contact number without email line', function () {
Mail::fake();
$mailable = new WorkshopRegistrationMail('Test Name', '0599123456', null);
Mail::to('info@libra.adv.ps')->send($mailable);
$rendered = $mailable->render();
expect($rendered)
->toContain('Test Name')
->toContain('0599123456');
Mail::assertQueued(WorkshopRegistrationMail::class, function ($mail) {
return ! str_contains($mail->render(), 'البريد الإلكتروني');
});
});
test('workshop registration email renders email address when provided', function () {
Mail::fake();
$mailable = new WorkshopRegistrationMail('Test Name', '0599123456', 'test@example.com');
Mail::to('info@libra.adv.ps')->send($mailable);
$rendered = $mailable->render();
expect($rendered)
->toContain('Test Name')
->toContain('0599123456')
->toContain('test@example.com');
});