mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-15 11:14:31 +08:00
19 lines
830 B
TypeScript
19 lines
830 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
const source = readFileSync(new URL('./QueryEditorToolbar.tsx', import.meta.url), 'utf8');
|
|
|
|
describe('QueryEditorToolbar AI trigger affordance', () => {
|
|
it('keeps a direct toolbar trigger for inline AI completion', () => {
|
|
expect(source).toContain('onMouseDown={onCaptureEditorCursorPosition}');
|
|
expect(source).toContain('onClick={onTriggerSqlAiCompletion}');
|
|
expect(source).toContain('triggerSqlAiCompletionLabel');
|
|
expect(source).toMatch(/aria-label="AI more actions"\s+onMouseDown=\{onCaptureEditorCursorPosition\}/);
|
|
});
|
|
|
|
it('keeps the secondary AI dropdown for other actions', () => {
|
|
expect(source).toContain('icon={<DownOutlined />}');
|
|
expect(source).toContain('menu={{ items: aiMenuItems }}');
|
|
});
|
|
});
|