wip: article AI polish, category SEO fields, cover generator, membership plan seeder
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Contracts\LlmProvider;
|
||||
use App\Domain\Ai\Jobs\ModerateCommentJob;
|
||||
use App\Domain\Ai\Jobs\OptimizeArticleContentJob;
|
||||
use App\Models\Article;
|
||||
use App\Models\Category;
|
||||
use App\Models\Comment;
|
||||
use App\Models\User;
|
||||
use App\Settings\AiSettings;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Tests\TestCase;
|
||||
@@ -31,13 +33,15 @@ class AiPipelineTest extends TestCase
|
||||
]);
|
||||
|
||||
(new OptimizeArticleContentJob($article->id))->handle(
|
||||
app(\App\Contracts\LlmProvider::class),
|
||||
app(\App\Settings\AiSettings::class),
|
||||
app(LlmProvider::class),
|
||||
app(AiSettings::class),
|
||||
);
|
||||
|
||||
$article->refresh();
|
||||
$this->assertNotEmpty($article->ai_summary);
|
||||
$this->assertIsArray($article->ai_suggestions);
|
||||
$this->assertNotEmpty($article->ai_polished_content);
|
||||
$this->assertStringContainsString('Hello world body', (string) $article->ai_polished_content);
|
||||
}
|
||||
|
||||
public function test_moderate_job_approves_non_spam(): void
|
||||
@@ -63,8 +67,8 @@ class AiPipelineTest extends TestCase
|
||||
]);
|
||||
|
||||
(new ModerateCommentJob($comment->id))->handle(
|
||||
app(\App\Contracts\LlmProvider::class),
|
||||
app(\App\Settings\AiSettings::class),
|
||||
app(LlmProvider::class),
|
||||
app(AiSettings::class),
|
||||
);
|
||||
|
||||
$this->assertSame(Comment::STATUS_APPROVED, $comment->fresh()->moderation_status);
|
||||
|
||||
Reference in New Issue
Block a user