前端极简黑白重设计,并纳入客户端注册、站点设置与后台相关改动
- storefront 全站改为极简黑白配色:直角、细线分隔、卡片 hover 浅底、深色模式(跟随系统+手动切换) - 抽出 storefront/partials/card 复用卡片 - 一并提交此前暂存的客户端注册 API、站点设置、后台页面与测试 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class WebAdminSettingsPageTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_authenticated_admin_can_update_storefront_settings(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
|
||||
$payload = [
|
||||
'site_name' => 'Team Store',
|
||||
'site_tagline' => 'Custom Extension Catalog',
|
||||
'home_title_suffix' => '自定义副标题',
|
||||
'home_eyebrow' => 'Custom Eyebrow',
|
||||
'home_headline' => '自定义首页标题',
|
||||
'home_lede' => '这里是自定义首页说明。',
|
||||
'home_aside_kicker' => 'Custom Aside',
|
||||
'home_aside_title' => '自定义侧栏标题',
|
||||
'home_feature_one_title' => '卡片一',
|
||||
'home_feature_one_body' => '卡片一说明',
|
||||
'home_feature_two_title' => '卡片二',
|
||||
'home_feature_two_body' => '卡片二说明',
|
||||
'home_feature_three_title' => '卡片三',
|
||||
'home_feature_three_body' => '卡片三说明',
|
||||
'home_plugins_title' => '插件精选',
|
||||
'home_plugins_subtitle' => '插件区域说明',
|
||||
'home_themes_title' => '主题精选',
|
||||
'home_themes_subtitle' => '主题区域说明',
|
||||
];
|
||||
|
||||
$this->actingAs($user)
|
||||
->put('/admin/settings', $payload)
|
||||
->assertRedirect('/admin/settings')
|
||||
->assertSessionHas('success', '站点设置已更新');
|
||||
|
||||
$this->assertDatabaseHas('store_settings', [
|
||||
'key' => 'site_name',
|
||||
'value' => 'Team Store',
|
||||
]);
|
||||
|
||||
$this->get('/')
|
||||
->assertOk()
|
||||
->assertSee('Team Store')
|
||||
->assertSee('自定义首页标题')
|
||||
->assertSee('插件精选')
|
||||
->assertSee('主题精选')
|
||||
->assertSee('<title>Team Store · 自定义副标题</title>', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user