前端极简黑白重设计,并纳入客户端注册、站点设置与后台相关改动
- storefront 全站改为极简黑白配色:直角、细线分隔、卡片 hover 浅底、深色模式(跟随系统+手动切换) - 抽出 storefront/partials/card 复用卡片 - 一并提交此前暂存的客户端注册 API、站点设置、后台页面与测试 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\Package;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class WebAdminPackageCategoriesTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_admin_can_update_package_categories_and_missing_categories_are_created(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
|
||||
$package = Package::query()->create([
|
||||
'type' => 'plugin',
|
||||
'slug' => 'HelloStore',
|
||||
'name' => 'Hello Store',
|
||||
'summary' => '',
|
||||
'description' => '',
|
||||
'author' => '',
|
||||
'homepage' => '',
|
||||
'icon_url' => '',
|
||||
'license' => '',
|
||||
'status' => 'published',
|
||||
'is_featured' => false,
|
||||
'sort_order' => 0,
|
||||
'download_count' => 0,
|
||||
'latest_version' => '',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->put('/admin/packages/plugin/HelloStore', [
|
||||
'type' => 'plugin',
|
||||
'slug' => 'HelloStore',
|
||||
'name' => 'Hello Store',
|
||||
'status' => 'published',
|
||||
'categories_text' => 'SEO performance_cache',
|
||||
])
|
||||
->assertRedirect('/admin/packages/plugin/HelloStore')
|
||||
->assertSessionHas('success', '扩展已更新');
|
||||
|
||||
$package->refresh()->load('categories');
|
||||
|
||||
$this->assertSame(['performance-cache', 'seo'], $package->categories->pluck('slug')->sort()->values()->all());
|
||||
|
||||
$this->assertDatabaseHas('store_categories', [
|
||||
'type' => 'plugin',
|
||||
'slug' => 'seo',
|
||||
'name' => 'Seo',
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('store_categories', [
|
||||
'type' => 'plugin',
|
||||
'slug' => 'performance-cache',
|
||||
'name' => 'Performance Cache',
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_admin_can_update_package_categories_with_chinese_names(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
|
||||
$package = Package::query()->create([
|
||||
'type' => 'plugin',
|
||||
'slug' => 'HelloWorld',
|
||||
'name' => 'Hello World',
|
||||
'summary' => '',
|
||||
'description' => '',
|
||||
'author' => '',
|
||||
'homepage' => '',
|
||||
'icon_url' => '',
|
||||
'license' => '',
|
||||
'status' => 'published',
|
||||
'is_featured' => false,
|
||||
'sort_order' => 0,
|
||||
'download_count' => 0,
|
||||
'latest_version' => '',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->put('/admin/packages/plugin/HelloWorld', [
|
||||
'type' => 'plugin',
|
||||
'slug' => 'HelloWorld',
|
||||
'name' => 'Hello World',
|
||||
'status' => 'published',
|
||||
'categories_text' => '性能优化, 内容增强',
|
||||
])
|
||||
->assertRedirect('/admin/packages/plugin/HelloWorld')
|
||||
->assertSessionHas('success', '扩展已更新');
|
||||
|
||||
$package->refresh()->load('categories');
|
||||
|
||||
$this->assertSame(['内容增强', '性能优化'], $package->categories->pluck('name')->sort()->values()->all());
|
||||
|
||||
$this->assertDatabaseHas('store_categories', [
|
||||
'type' => 'plugin',
|
||||
'slug' => '性能优化',
|
||||
'name' => '性能优化',
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('store_categories', [
|
||||
'type' => 'plugin',
|
||||
'slug' => '内容增强',
|
||||
'name' => '内容增强',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user