From a37dc1c469ff29688b69affe860597b3aaf5d46c Mon Sep 17 00:00:00 2001 From: mango <1711456624@qq.com> Date: Tue, 28 Jul 2026 17:48:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(test):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=9F=BA=E7=BA=BF=E6=B5=8B=E8=AF=95=E6=96=AD?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/QueryEditorToolbar.layout.test.tsx | 6 ++++-- frontend/src/utils/connectionTypeCatalog.test.ts | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/QueryEditorToolbar.layout.test.tsx b/frontend/src/components/QueryEditorToolbar.layout.test.tsx index 66f06712..673876dd 100644 --- a/frontend/src/components/QueryEditorToolbar.layout.test.tsx +++ b/frontend/src/components/QueryEditorToolbar.layout.test.tsx @@ -65,8 +65,10 @@ describe('QueryEditorToolbar layout', () => { expect(css).toContain('.gn-v2-query-transaction-commit-button:hover'); expect(css).toContain('.gn-v2-query-transaction-commit-button:focus-visible'); - expect(commitBaseCss).toContain('background: var(--gn-accent-soft) !important;'); - expect(commitHoverCss).not.toContain('background: var(--gn-accent-soft) !important;'); + expect(commitBaseCss).toContain('background: var(--gn-warn) !important;'); + expect(commitHoverCss).toContain( + 'background: var(--gn-warn-hover, var(--gn-warn)) !important;', + ); expect(commitHoverCss).toContain('box-shadow:'); expect(commitKbdHoverCss).toContain('background:'); }); diff --git a/frontend/src/utils/connectionTypeCatalog.test.ts b/frontend/src/utils/connectionTypeCatalog.test.ts index a37f0f8e..59e2a3cf 100644 --- a/frontend/src/utils/connectionTypeCatalog.test.ts +++ b/frontend/src/utils/connectionTypeCatalog.test.ts @@ -15,6 +15,7 @@ const translatedCopy: Record = { 'connection_modal.step1.group.vector': 'T:vector', 'connection_modal.step1.group.timeseries': 'T:timeseries', 'connection_modal.step1.group.message_queue': 'T:message-queue', + 'connection_modal.step1.group.config_center': 'T:config-center', 'connection_modal.step1.group.other': 'T:other', 'connection_modal.step1.hint.redis': 'T:redis', 'connection_modal.step1.hint.mongodb': 'T:mongodb', @@ -22,6 +23,7 @@ const translatedCopy: Record = { 'connection_modal.step1.hint.chroma': 'T:chroma', 'connection_modal.step1.hint.qdrant': 'T:qdrant', 'connection_modal.step1.hint.milvus': 'T:milvus', + 'connection_modal.step1.hint.nacos': 'T:nacos', 'connection_modal.step1.hint.oceanBase': 'T:oceanbase', 'connection_modal.step1.hint.goldendb': 'T:goldendb', 'connection_modal.step1.hint.file': 'T:file', @@ -40,6 +42,7 @@ describe('connectionTypeCatalog', () => { 'connection_modal.step1.group.vector', 'connection_modal.step1.group.timeseries', 'connection_modal.step1.group.message_queue', + 'connection_modal.step1.group.config_center', 'connection_modal.step1.group.other', ]); expect(buildConnectionTypeGroups(translate).map((group) => group.label)).toEqual([ @@ -49,6 +52,7 @@ describe('connectionTypeCatalog', () => { 'T:vector', 'T:timeseries', 'T:message-queue', + 'T:config-center', 'T:other', ]); expect( @@ -71,6 +75,7 @@ describe('connectionTypeCatalog', () => { expect(keys).toContain('milvus'); expect(keys).toContain('iotdb'); expect(keys).toContain('kafka'); + expect(keys).toContain('nacos'); expect(keys).toContain('jvm'); expect(keys).toContain('custom'); expect(new Set(keys).size).toBe(keys.length); @@ -93,6 +98,7 @@ describe('connectionTypeCatalog', () => { expect(getConnectionTypeDefaultPort('milvus')).toBe(19530); expect(getConnectionTypeDefaultPort('iotdb')).toBe(6667); expect(getConnectionTypeDefaultPort('kafka')).toBe(9092); + expect(getConnectionTypeDefaultPort('nacos')).toBe(8848); expect(getConnectionTypeDefaultPort('sqlite')).toBe(0); expect(getConnectionTypeDefaultPort('duckdb')).toBe(0); expect(getConnectionTypeDefaultPort('unknown')).toBe(3306); @@ -107,6 +113,7 @@ describe('connectionTypeCatalog', () => { expect(getConnectionTypeHint('milvus', translate)).toBe('T:milvus'); expect(getConnectionTypeHint('iotdb')).toContain('Timeseries'); expect(getConnectionTypeHint('kafka')).toContain('Consumer Group'); + expect(getConnectionTypeHint('nacos', translate)).toBe('T:nacos'); expect(getConnectionTypeHint('oceanbase', translate)).toBe('T:oceanbase'); expect(getConnectionTypeHint('goldendb', translate)).toBe('T:goldendb'); expect(getConnectionTypeHint('trino')).toBe('HTTP / HTTPS / catalog.schema');