diff --git a/web/src/pages/accounts/monitoring/$id/index.tsx b/web/src/pages/accounts/monitoring/$id/index.tsx index e9f4c84..b77eedc 100644 --- a/web/src/pages/accounts/monitoring/$id/index.tsx +++ b/web/src/pages/accounts/monitoring/$id/index.tsx @@ -136,42 +136,50 @@ export default function Page() { {competitor.nickname || competitor.platform_account_key} {syncMeta.label} + + 抖音主页 + + + {[ + { label: '关注', value: competitor.following_count }, + { label: '粉丝', value: competitor.follower_count }, + { label: '获赞', value: competitor.total_favorited }, + ].map(({ label, value }) => ( + + {formatCount(value)} + {label} + + ))} + + {competitor.signature ? ( + + + {competitor.signature} + + + {competitor.signature} + + } + > + 更多 + + + ) : null} - - {competitor.signature} - - - {competitor.signature} - - } - > - 更多 - - - ) : ( - '—' - ) }, { key: 'lastSync', label: '上次同步', children: competitor.last_sync_at ? dateTime(competitor.last_sync_at) : '—' }, { key: 'nextSync', label: '下次自动同步', children: competitor.next_sync_at ? dateTime(competitor.next_sync_at) : '—' }, { diff --git a/web/tests/monitoring-account-detail.test.cjs b/web/tests/monitoring-account-detail.test.cjs index 9c17f0e..01cb3b0 100644 --- a/web/tests/monitoring-account-detail.test.cjs +++ b/web/tests/monitoring-account-detail.test.cjs @@ -12,21 +12,37 @@ const source = ts.createSourceFile( ); const code = source.getFullText(); -test('监控账号详情展示获赞与作者介绍', () => { - assert.ok(code.includes('total_favorited'), '接口类型应包含 total_favorited'); - assert.ok(code.includes("competitor.signature"), '接口类型应包含 signature'); - assert.ok(code.includes("label: '获赞'"), 'Descriptions 应有获赞项'); - assert.ok(code.includes("label: '作者介绍'"), 'Descriptions 应有作者介绍项'); - assert.ok(code.includes('formatCount(competitor.total_favorited)'), '获赞应走 formatCount'); +test('关注、粉丝、获赞单独一行,正常字体颜色', () => { + // 从 Descriptions 移出,不再以 label+children 形式出现 + for (const label of ['粉丝', '关注', '获赞']) { + assert.ok(!code.includes(`label: '${label}', children:`), `${label} 不应留在 Descriptions`); + } + assert.ok(code.includes('competitor.following_count'), '应有关注数'); + assert.ok(code.includes('competitor.follower_count'), '应有粉丝数'); + assert.ok(code.includes('competitor.total_favorited'), '应有获赞数'); + assert.ok(code.includes("{ label: '关注', value: competitor.following_count }"), '关注数据行'); + assert.ok(code.includes("{ label: '粉丝', value: competitor.follower_count }"), '粉丝数据行'); + assert.ok(code.includes("{ label: '获赞', value: competitor.total_favorited }"), '获赞数据行'); + assert.match(code, /formatCount\(value\)/, '计数统一走 formatCount'); + // 不灰:画像区不得使用 secondary 灰色文本 + assert.doesNotMatch(code, /type="secondary"/, '画像数据应为正常颜色'); }); -test('作者介绍单行展示,结尾「更多」hover 弹出全文', () => { - // 单行省略:Typography.Text ellipsis +test('作者介绍单独一行,不展示「作者介绍」label', () => { + assert.ok(!code.includes("label: '作者介绍'"), '不应有作者介绍 label'); + assert.ok(code.includes('competitor.signature'), '应有签名数据'); + // 单行省略 + 结尾「更多」hover 弹出全文,保留换行 assert.match(code, /]*ellipsis/, '作者介绍应为单行省略文本'); - // 更多触发器 + Popover 展示全文,保留换行 assert.match(code, /更多 { + assert.ok( + code.includes('https://www.douyin.com/user/${competitor.platform_account_key}'), + '主页链接应使用平台账号拼接', + ); + assert.doesNotMatch(code, /label: '平台账号'/, '不应再展示平台账号项'); +});