mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-19 16:16:45 +00:00
fix(plugin): preserve plugin tabs and test fixtures
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ const appSource = readFileSync(new URL("../../../App.vue", import.meta.url), "ut
|
||||
// assertions pin the sibling order so a future merge cannot re-introduce it.
|
||||
describe("App main content surface structure", () => {
|
||||
it("hides only the editor workspace via the surface guard, never the special pages", () => {
|
||||
const guard = 'v-show="!driverStoreActive && !settingsStore.settingsPageActive"';
|
||||
const guard = 'v-show="!driverStoreActive && !pluginCenterActive && !settingsStore.settingsPageActive"';
|
||||
// The empty-state slot shares the query surface's visibility guard.
|
||||
expect(appSource.split(guard).length - 1).toBe(1);
|
||||
|
||||
|
||||
@@ -551,7 +551,7 @@ onBeforeUnmount(() => {
|
||||
<div class="mt-3 text-sm font-medium">{{ t("pluginPlatform.noMarketplacePlugins") }}</div>
|
||||
<div class="mt-1 text-xs text-muted-foreground">{{ t("pluginPlatform.noMarketplacePluginsDescription") }}</div>
|
||||
</div>
|
||||
<div v-else-if="marketplaceViewMode === 'grid'" class="grid w-full grid-cols-1 gap-3 md:grid-cols-3">
|
||||
<div v-else-if="marketplaceViewMode === 'grid'" class="grid w-full grid-cols-[repeat(auto-fit,minmax(220px,1fr))] gap-3">
|
||||
<article v-for="listing in filteredMarketplaceListings" :key="listing.key" class="group flex min-w-0 min-h-48 flex-col rounded-xl border bg-card p-4 transition-colors hover:border-primary/40">
|
||||
<div class="flex items-start gap-3">
|
||||
<PluginIcon :plugin-id="listing.plugin.id" :icon="listing.plugin.icon" class="size-11 rounded-xl border bg-background p-1.5" />
|
||||
|
||||
@@ -47,6 +47,8 @@ export interface SavedOpenTab {
|
||||
whereInput?: string;
|
||||
pinned?: boolean;
|
||||
mode?: QueryTab["mode"];
|
||||
pluginWorkbench?: QueryTab["pluginWorkbench"];
|
||||
pluginFilesystem?: QueryTab["pluginFilesystem"];
|
||||
autoCommit?: boolean;
|
||||
mqTenant?: string;
|
||||
mqInitialTab?: QueryTab["mqInitialTab"];
|
||||
@@ -180,6 +182,8 @@ export function serializeOpenTabs(tabs: QueryTab[]): SavedOpenTab[] {
|
||||
...(tab.whereInput !== undefined ? { whereInput: tab.whereInput } : {}),
|
||||
pinned: tab.pinned,
|
||||
mode: tab.mode,
|
||||
...(tab.pluginWorkbench ? { pluginWorkbench: tab.pluginWorkbench } : {}),
|
||||
...(tab.pluginFilesystem ? { pluginFilesystem: tab.pluginFilesystem } : {}),
|
||||
...(tab.mode === "query" && tab.autoCommit !== undefined ? { autoCommit: tab.autoCommit } : {}),
|
||||
...(tab.mqTenant !== undefined ? { mqTenant: tab.mqTenant } : {}),
|
||||
...(tab.mqInitialTab !== undefined ? { mqInitialTab: tab.mqInitialTab } : {}),
|
||||
|
||||
@@ -8606,7 +8606,11 @@ for line in sys.stdin:
|
||||
..Default::default()
|
||||
},
|
||||
path: dir.clone(),
|
||||
compatibility: PluginCompatibility { compatible: true, ..Default::default() },
|
||||
compatibility: PluginCompatibility {
|
||||
compatible: true,
|
||||
backend_executable: Some(dir.join("plugin.sh")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
let session = PluginDriverSession::start_for_test(plugin, "jdbc".to_string(), PluginRuntimeEnv::default())
|
||||
.await
|
||||
@@ -8708,7 +8712,11 @@ for line in sys.stdin:
|
||||
..Default::default()
|
||||
},
|
||||
path: dir.clone(),
|
||||
compatibility: PluginCompatibility { compatible: true, ..Default::default() },
|
||||
compatibility: PluginCompatibility {
|
||||
compatible: true,
|
||||
backend_executable: Some(dir.join("plugin.sh")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
let session = Arc::new(
|
||||
PluginDriverSession::start_for_test(plugin, "jdbc".to_string(), PluginRuntimeEnv::default())
|
||||
@@ -8820,7 +8828,11 @@ for line in sys.stdin:
|
||||
..Default::default()
|
||||
},
|
||||
path: dir.clone(),
|
||||
compatibility: PluginCompatibility { compatible: true, ..Default::default() },
|
||||
compatibility: PluginCompatibility {
|
||||
compatible: true,
|
||||
backend_executable: Some(dir.join("plugin.sh")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
let session = PluginDriverSession::start_for_test(plugin, "jdbc".to_string(), PluginRuntimeEnv::default())
|
||||
.await
|
||||
@@ -8880,7 +8892,11 @@ for line in sys.stdin:
|
||||
..Default::default()
|
||||
},
|
||||
path: dir.clone(),
|
||||
compatibility: PluginCompatibility { compatible: true, ..Default::default() },
|
||||
compatibility: PluginCompatibility {
|
||||
compatible: true,
|
||||
backend_executable: Some(dir.join("plugin.sh")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
let session = PluginDriverSession::start_for_test(plugin, "jdbc".to_string(), PluginRuntimeEnv::default())
|
||||
.await
|
||||
|
||||
@@ -3643,7 +3643,11 @@ done
|
||||
..PluginManifest::default()
|
||||
},
|
||||
path: dir.clone(),
|
||||
compatibility: crate::plugins::PluginCompatibility { compatible: true, ..Default::default() },
|
||||
compatibility: crate::plugins::PluginCompatibility {
|
||||
compatible: true,
|
||||
backend_executable: Some(dir.join("plugin.sh")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
let session = std::sync::Arc::new(
|
||||
PluginDriverSession::start_for_test(plugin, "jdbc".to_string(), PluginRuntimeEnv::default()).await.unwrap(),
|
||||
|
||||
+6
-6
@@ -52,7 +52,7 @@ test("query result toolbar reuses the production icon contract", () => {
|
||||
assert.match(contentArea, /<Wrench class="h-4 w-4"/);
|
||||
assert.match(contentArea, /<ChevronDown class="h-3\.5 w-3\.5"/);
|
||||
assert.match(viewSwitcher, /import \{ BarChart3, ListChecks, MessageSquareText \} from "@lucide\/vue"/);
|
||||
assert.match(toolbarActions, /import \{ GitBranch, Gauge, Loader2, Upload \} from "@lucide\/vue"/);
|
||||
assert.match(toolbarActions, /import \{ GitBranch, Gauge, Loader2, PlugZap, Upload \} from "@lucide\/vue"/);
|
||||
assert.match(editorToolbar, /@click="emit\('importResultArchive'\)"[\s\S]{0,100}<Download/);
|
||||
assert.match(toolbarActions, /@click="emit\('exportArchive'\)"[\s\S]{0,200}<Upload v-else/);
|
||||
assert.match(dataGrid, /return \{ label: t\("grid\.export"\), icon: Upload, children: items \};/);
|
||||
@@ -112,12 +112,12 @@ test("appending a result run preserves the tab-strip scroll position", () => {
|
||||
|
||||
test("the close-tab shortcut clears query results before closing the tab", () => {
|
||||
const app = source(appPath);
|
||||
const closeShortcutStart = app.indexOf("if (isCloseTabShortcut(e, shortcuts))");
|
||||
const closeShortcutEnd = app.indexOf("if (isSaveShortcut", closeShortcutStart);
|
||||
const closeShortcut = app.slice(closeShortcutStart, closeShortcutEnd);
|
||||
const closeSurfaceStart = app.indexOf("async function closeActiveSurface()");
|
||||
const closeSurfaceEnd = app.indexOf("function activateMainContentSurface", closeSurfaceStart);
|
||||
const closeSurface = app.slice(closeSurfaceStart, closeSurfaceEnd);
|
||||
|
||||
assert.ok(closeShortcutStart >= 0);
|
||||
assert.ok(closeShortcut.indexOf("await queryStore.clearQueryResults(queryStore.activeTabId)") < closeShortcut.indexOf("queryStore.closeTab(queryStore.activeTabId)"));
|
||||
assert.ok(closeSurfaceStart >= 0);
|
||||
assert.ok(closeSurface.indexOf("await queryStore.clearQueryResults(queryStore.activeTabId)") < closeSurface.indexOf("queryStore.closeTab(queryStore.activeTabId)"));
|
||||
});
|
||||
|
||||
test("the configurable results pane shortcut only toggles existing output", () => {
|
||||
|
||||
Reference in New Issue
Block a user