From c68d312372999f696ddca35bb6f394061878602d Mon Sep 17 00:00:00 2001 From: Aomsir Date: Sun, 25 Oct 2026 16:52:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(grok):=20=E6=9C=AA=E7=9F=A5=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=AF=A6=E6=83=85=E6=94=B9=E4=B8=BA=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/GrokModelDiagnosticsPanel.vue | 4 ++-- .../__tests__/GrokModelDiagnosticsPanel.spec.ts | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/account/GrokModelDiagnosticsPanel.vue b/frontend/src/components/account/GrokModelDiagnosticsPanel.vue index c9847b74cf..f1fa64ef8a 100644 --- a/frontend/src/components/account/GrokModelDiagnosticsPanel.vue +++ b/frontend/src/components/account/GrokModelDiagnosticsPanel.vue @@ -137,7 +137,7 @@
- {{ effectiveState === 'stale' || effectiveState === 'source_changed' + {{ effectiveState !== 'fresh' ? t('admin.accounts.grokModelDiagnostics.historicalSource') : t('admin.accounts.grokModelDiagnostics.source') }}
@@ -164,7 +164,7 @@

- {{ effectiveState === 'stale' || effectiveState === 'source_changed' + {{ effectiveState !== 'fresh' ? t('admin.accounts.grokModelDiagnostics.historicalModels') : t('admin.accounts.grokModelDiagnostics.upstreamModels') }}

diff --git a/frontend/src/components/account/__tests__/GrokModelDiagnosticsPanel.spec.ts b/frontend/src/components/account/__tests__/GrokModelDiagnosticsPanel.spec.ts index f2f5454a25..1c09591fa3 100644 --- a/frontend/src/components/account/__tests__/GrokModelDiagnosticsPanel.spec.ts +++ b/frontend/src/components/account/__tests__/GrokModelDiagnosticsPanel.spec.ts @@ -340,8 +340,11 @@ describe('GrokModelDiagnosticsPanel', () => { if (normalized) expect(text).not.toContain(normalized) expect(text).not.toContain(NOT_LISTED_ZH) expect(text).not.toContain('当前有效') - expect(text).not.toContain('历史目录') + expect(wrapper.get('[data-testid="grok-diagnostics-state"]').text()).not.toContain('历史目录') expect(text).not.toContain('来源已变更') + const details = wrapper.get('[data-testid="grok-diagnostics-details"]') + expect(details.get('dt').text()).toBe('历史目录来源') + expect(details.findAll('h4')[0].text()).toBe('历史目录') }) it('keeps a real leap day, numeric offset, and fractional second as the last success', async () => { @@ -390,6 +393,10 @@ describe('GrokModelDiagnosticsPanel', () => { expect(text).not.toContain(NOT_LISTED_ZH) expect(text).not.toContain('当前有效') expect(text).toContain('grok-4.7') + expect(wrapper.get('[data-testid="grok-diagnostics-state"]').text()).not.toContain('历史目录') + const details = wrapper.get('[data-testid="grok-diagnostics-details"]') + expect(details.get('dt').text()).toBe('历史目录来源') + expect(details.findAll('h4')[0].text()).toBe('历史目录') }) it('treats listed rows in a stale catalog as history rather than a current result', async () => { @@ -736,6 +743,10 @@ describe('GrokModelDiagnosticsPanel', () => { expect(wrapper.text()).toContain('configured-only') expect(wrapper.text()).not.toContain(NOT_LISTED_ZH) expect(wrapper.text()).toContain('历史记录,需重新同步后核验') + expect(wrapper.get('[data-testid="grok-diagnostics-state"]').text()).toContain('未知') + const details = wrapper.get('[data-testid="grok-diagnostics-details"]') + expect(details.get('dt').text()).toBe('历史目录来源') + expect(details.findAll('h4')[0].text()).toBe('历史目录') }) it.each([ @@ -793,6 +804,10 @@ describe('GrokModelDiagnosticsPanel', () => { expect(wrapper.text()).toContain('grok-4.7') expect(wrapper.text()).not.toContain(NOT_LISTED_ZH) expect(wrapper.text()).toContain('历史记录,需重新同步后核验') + expect(wrapper.get('[data-testid="grok-diagnostics-state"]').text()).not.toContain('历史目录') + const details = wrapper.get('[data-testid="grok-diagnostics-details"]') + expect(details.get('dt').text()).toBe('历史目录来源') + expect(details.findAll('h4')[0].text()).toBe('历史目录') }) it('keeps refresh failure, the unsaved hint, and trusted gaps together', () => {