diff --git a/frontend/src/components/Sidebar.locate-toolbar.test.tsx b/frontend/src/components/Sidebar.locate-toolbar.test.tsx index e386cb0..a13ac2a 100644 --- a/frontend/src/components/Sidebar.locate-toolbar.test.tsx +++ b/frontend/src/components/Sidebar.locate-toolbar.test.tsx @@ -745,6 +745,7 @@ describe('Sidebar locate toolbar', () => { expect(markup).toContain('data-sidebar-batch-database-action="true"'); expect(markup).toContain('data-sidebar-open-external-sql-file-action="true"'); expect(markup).toContain('data-sidebar-locate-current-tab-action="true"'); + expect(markup).toContain('data-gonavi-new-query-action="true"'); expect(markup).toContain('data-gonavi-create-connection-action="true"'); expect(markup).toContain('aria-label="AI 助手"'); expect(markup).toContain('data-gonavi-ai-entry-action="true"'); @@ -1001,9 +1002,50 @@ describe('Sidebar locate toolbar', () => { expect(css).toMatch(/\.gn-v2-rail-tool \{[^}]*height: calc\(32px \* var\(--gn-ui-scale, 1\)\);/s); expect(css).toMatch(/\.gn-v2-rail-tool \{[^}]*width: calc\(24px \* var\(--gn-ui-scale, 1\)\);/s); expect(css).toMatch(/\.gn-v2-active-connection-trigger \{[^}]*height: 34px;[^}]*border: 0;[^}]*background: transparent;/s); + expect(css).toMatch(/\.gn-v2-active-connection-query-action \{[^}]*max-width: 96px;[^}]*font-size: 12px;/s); expect(css).not.toContain('.gn-v2-active-connection-trigger:hover'); }); + it('shows a prominent v2 new query action before connection creation without reusing the plus icon', () => { + mocks.state.connections = [{ + id: 'conn-local', + name: '开发240', + config: { + type: 'mysql', + host: 'front_end_sys_dev', + port: 3306, + }, + }]; + mocks.state.activeContext = { connectionId: 'conn-local', dbName: 'front_end_sys_dev' }; + mocks.state.appearance = { + enabled: true, + opacity: 1, + blur: 0, + uiVersion: 'v2', + }; + + const markup = renderSidebarMarkup({ uiVersion: 'v2', onCreateConnection: mocks.noop }); + const sidebarSource = readSourceFile('./Sidebar.tsx'); + const headerSource = sidebarSource.slice( + sidebarSource.indexOf('