feat: restore sablog browse modes and clean imported HTML
Build and Deploy / verify (push) Successful in 40s
Build and Deploy / deploy (push) Successful in 36s

Keep the public site readable after import (nbsp, highlighter, wrapping code, compact pager) and finish the admin extras already in this tree: sticky levels, preview, page cache, and live llms.txt.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gouki
2026-09-18 21:33:02 +00:00
co-authored by Cursor
parent 469160dc3f
commit ae47447062
98 changed files with 8618 additions and 901 deletions
+39 -7
View File
@@ -2,8 +2,11 @@
namespace Tests\Feature;
use App\Blog\Support\PluginManager;
use App\Filament\Support\AdminEnvironment;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Plugins\Demo\HelloWorld\ServiceProvider;
use Tests\TestCase;
class AdminPagesTest extends TestCase
@@ -32,12 +35,40 @@ class AdminPagesTest extends TestCase
public function test_post_resource_loads(): void
{
$this->actingAs($this->admin)->get('/admin/posts')->assertOk();
$this->actingAs($this->admin)->get('/admin/posts/create')->assertOk();
$this->actingAs($this->admin)->get('/admin/posts/create')
->assertOk()
->assertSee('Slug(留空自动生成)', false)
->assertSee('封面图', false)
->assertSee('ll-media-picker-preview', false)
->assertSee('评论状态', false)
->assertSee('访问设置', false)
->assertSee('会员专享', false)
->assertSee('价格', false)
->assertSee('置顶头条', false)
->assertSee('轻置顶', false);
}
public function test_settings_page_loads(): void
{
$this->actingAs($this->admin)->get('/admin/blog-settings')->assertOk();
$this->actingAs($this->admin)
->get('/admin/blog-settings')
->assertOk()
->assertSee('首页浏览模式', false);
}
public function test_page_cache_and_language_pages_load(): void
{
$this->actingAs($this->admin)
->get('/admin/page-cache')
->assertOk()
->assertSee('页面缓存', false)
->assertSee('已缓存的前台页面', false);
$this->actingAs($this->admin)
->get('/admin/languages')
->assertOk()
->assertSee('文章多语言', false)
->assertSee('未开通', false);
}
public function test_comment_resource_loads(): void
@@ -77,8 +108,8 @@ class AdminPagesTest extends TestCase
$original = app()->environment();
app()['env'] = 'production';
$this->assertSame('prod', \App\Filament\Support\AdminEnvironment::name());
$this->assertSame('danger', \App\Filament\Support\AdminEnvironment::color());
$this->assertSame('prod', AdminEnvironment::name());
$this->assertSame('danger', AdminEnvironment::color());
app()['env'] = $original;
}
@@ -88,16 +119,17 @@ class AdminPagesTest extends TestCase
$this->actingAs($this->admin)
->get('/admin')
->assertOk()
->assertSee(\App\Filament\Support\AdminEnvironment::name(), false)
->assertSee(AdminEnvironment::name(), false)
->assertSee('写文章', false)
->assertSee('网站', false)
->assertSee('/admin/posts/create', false);
}
public function test_hello_world_plugin_pages_load_when_enabled(): void
{
$manager = app(\App\Blog\Support\PluginManager::class);
$manager = app(PluginManager::class);
$manager->enable('demo.hello-world');
\Plugins\Demo\HelloWorld\ServiceProvider::bootPlugin($manager);
ServiceProvider::bootPlugin($manager);
$this->actingAs($this->admin)->get('/admin')->assertOk();
$this->actingAs($this->admin)->get('/admin/posts/create')->assertOk();