feat(editor): add table ddl hover preview switch

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-09-01 00:20:34 +08:00
1 parent f958bf4602
commit 5eb071bc22
17 files changed
+54 -2

No files matched your search

@@ -4,6 +4,11 @@ import { describe, expect, it } from "vitest";
const queryEditorSource = readFileSync(new URL("../../../components/editor/QueryEditor.vue", import.meta.url), "utf8");
describe("QueryEditor hover DDL copy", () => {
it("gates only the table DDL branch on the preference, keeping column hover", () => {
expect(queryEditorSource).not.toContain("if (!settingsStore.editorSettings.showTableDdlHoverPreview) return null;");
expect(queryEditorSource).toContain("if (table && settingsStore.editorSettings.showTableDdlHoverPreview && !semanticQualifierIsRowSource");
});
it("adds an accessible copy button that preserves SQL whitespace semantics", () => {
expect(queryEditorSource).toContain('copyButton.textContent = t("grid.copyDdl");');
expect(queryEditorSource).toContain('copyButton.setAttribute("aria-label", t("grid.copyDdl"));');