From 9826345577502e38296c261cb183fe91a1240353 Mon Sep 17 00:00:00 2001 From: smail Date: Wed, 30 Sep 2026 05:01:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=9F=A5=E6=A3=80=E6=9F=A5=E7=82=B9?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E6=AD=A3=E5=85=A8=E9=87=8F=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=A4=B9=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充 SMTP 测试表结构,更新管理端点数量断言,并同步前端回归测试夹具与布局断言。 --- backend/listen/smtp_server/email_authentication_test.go | 2 +- backend/services/access/access_test.go | 2 +- test/frontend/api-blob.test.mjs | 4 ++-- test/frontend/settings-menu.test.mjs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/listen/smtp_server/email_authentication_test.go b/backend/listen/smtp_server/email_authentication_test.go index eb82777..a8ade2b 100644 --- a/backend/listen/smtp_server/email_authentication_test.go +++ b/backend/listen/smtp_server/email_authentication_test.go @@ -135,7 +135,7 @@ func newAuthenticationTestEngine(t *testing.T) *xorm.Engine { t.Fatalf("创建测试数据库失败:%v", err) } engine.SetMaxOpenConns(1) - if err = engine.Sync2(&models.User{}, &models.Email{}, &models.UserEmail{}, &models.Rule{}); err != nil { + if err = engine.Sync2(&models.User{}, &models.Email{}, &models.UserEmail{}, &models.Rule{}, &models.UserTrustedSender{}); err != nil { t.Fatalf("初始化测试数据库失败:%v", err) } t.Cleanup(func() { _ = engine.Close() }) diff --git a/backend/services/access/access_test.go b/backend/services/access/access_test.go index 43da2d8..1f94ed6 100644 --- a/backend/services/access/access_test.go +++ b/backend/services/access/access_test.go @@ -94,7 +94,7 @@ func TestAdminPluginRestartScope(t *testing.T) { func TestManagementEndpointCatalog(t *testing.T) { endpoints := ManagementEndpoints() - if len(endpoints) != 37 { + if len(endpoints) != 47 { t.Fatalf("unexpected endpoint count: %d", len(endpoints)) } seen := map[string]struct{}{} diff --git a/test/frontend/api-blob.test.mjs b/test/frontend/api-blob.test.mjs index c44359e..237cd82 100644 --- a/test/frontend/api-blob.test.mjs +++ b/test/frontend/api-blob.test.mjs @@ -9,7 +9,7 @@ const createInterceptors = compileFunction( source.replace(/^import .*$/gm, '') .replace('import.meta.env.VITE_APP_URL', 'undefined') .replace('export {http};', ''), - ['axios', 'lang', 'router', 'createLoginRedirectHandler', 'decodeBlobAPIError'] + ['axios', 'lang', 'router', 'createLoginRedirectHandler', 'decodeBlobAPIError', 'useGlobalStatusStore'] ) function fixture() { @@ -17,7 +17,7 @@ function fixture() { let failure let redirects = 0 const http = { interceptors: { response: { use: (left, right) => { success = left; failure = right } } } } - createInterceptors({ create: () => http }, { lang: 'zh' }, {}, () => async () => { redirects++ }, decodeBlobAPIError) + createInterceptors({ create: () => http }, { lang: 'zh' }, {}, () => async () => { redirects++ }, decodeBlobAPIError, () => ({ clear() {} })) return { success, failure, redirects: () => redirects } } diff --git a/test/frontend/settings-menu.test.mjs b/test/frontend/settings-menu.test.mjs index 0e2da2f..ff1d72f 100644 --- a/test/frontend/settings-menu.test.mjs +++ b/test/frontend/settings-menu.test.mjs @@ -139,7 +139,7 @@ test('配置管理只在真实移动端将内部导航移到内容顶部', () => const containerStart = config.indexOf('@container settings-content (max-width: 560px)') const desktopStart = config.indexOf('@media (min-width: 769px)', containerStart) const containerRule = config.slice(containerStart, desktopStart) - assert.match(header, /min\(100vw, max\(56vw, 880px\)\)/) + assert.match(header, /min\(100vw, max\(72vw, 1100px\)\)/) assert.match(config, /grid-template-areas: "main submenu"/) assert.match(config, /@media \(min-width: 769px\)[\s\S]*grid-template-columns: minmax\(0, 1fr\)/) assert.match(config, /@media \(max-width: 768px\)[\s\S]*"submenu"[\s\S]*"main"/)