feat(ai): finalize AI magic edits epic rollout and operations
This commit is contained in:
46
tests/Unit/Models/AiStyleVersioningTest.php
Normal file
46
tests/Unit/Models/AiStyleVersioningTest.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Models;
|
||||
|
||||
use App\Models\AiStyle;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AiStyleVersioningTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_style_defaults_to_version_one_on_create(): void
|
||||
{
|
||||
$style = AiStyle::query()->create([
|
||||
'key' => 'style-version-default',
|
||||
'name' => 'Version Default',
|
||||
'provider' => 'runware',
|
||||
'provider_model' => 'runware-default',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$this->assertSame(1, $style->version);
|
||||
}
|
||||
|
||||
public function test_style_version_increments_when_core_style_fields_change(): void
|
||||
{
|
||||
$style = AiStyle::query()->create([
|
||||
'key' => 'style-version-increment',
|
||||
'name' => 'Version Increment',
|
||||
'provider' => 'runware',
|
||||
'provider_model' => 'runware-default',
|
||||
'prompt_template' => 'Initial prompt',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$this->assertSame(1, $style->version);
|
||||
|
||||
$style->update([
|
||||
'prompt_template' => 'Updated prompt',
|
||||
]);
|
||||
|
||||
$style->refresh();
|
||||
$this->assertSame(2, $style->version);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user