create(); $user = User::factory()->create(); StreamPostContent::dispatch( workspaceId: $workspace->id, userId: $user->id, generationId: 'gen-1', prompt: 'Write a post about Mondays', currentContent: null, ); Bus::assertDispatched(StreamPostContent::class, fn ($job) => $job->queue === 'ai'); }); test('job invokes the PostContentStreamer agent and broadcasts stream events', function () { $workspace = Workspace::factory()->create(); $user = User::factory()->create(); PostContentStreamer::fake(['Hello world']); $job = new StreamPostContent( workspaceId: $workspace->id, userId: $user->id, generationId: 'gen-abc', prompt: 'Write a post about Mondays', currentContent: null, ); $job->handle(); PostContentStreamer::assertPrompted('Write a post about Mondays'); });