mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-03 16:24:55 +00:00
🔥 **Cleanup:** Removed BookCase and OrangePill models, factories, migrations, and related references. Added tests for new service and meetup creation flows. Updated PHPUnit settings and browser-specific configurations.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use App\Jobs\FetchNostrProfileJob;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
|
||||
it('can be dispatched for a single user', function () {
|
||||
Queue::fake();
|
||||
$user = User::factory()->create(['nostr' => 'npub1'.str_repeat('a', 58)]);
|
||||
|
||||
FetchNostrProfileJob::dispatch($user);
|
||||
|
||||
Queue::assertPushed(
|
||||
FetchNostrProfileJob::class,
|
||||
fn (FetchNostrProfileJob $job) => $job->user?->id === $user->id,
|
||||
);
|
||||
});
|
||||
|
||||
it('can be dispatched without a user (batch mode)', function () {
|
||||
Queue::fake();
|
||||
|
||||
FetchNostrProfileJob::dispatch();
|
||||
|
||||
Queue::assertPushed(
|
||||
FetchNostrProfileJob::class,
|
||||
fn (FetchNostrProfileJob $job) => $job->user === null,
|
||||
);
|
||||
});
|
||||
|
||||
it('returns early when the supplied user has no nostr handle', function () {
|
||||
$user = User::factory()->create(['nostr' => null]);
|
||||
|
||||
(new FetchNostrProfileJob($user))->handle();
|
||||
|
||||
expect($user->refresh()->name)->not->toBeEmpty();
|
||||
});
|
||||
Reference in New Issue
Block a user