fix(tabs): allow duplicating data tabs with fresh results

This commit is contained in:
OOMEcho authored and GitHub committed 2026-09-30 19:47:51 +08:00
1 parent 5017aa7bb9
commit 5433f067d7
5 files changed
+91 -9

No files matched your search

@@ -167,6 +167,20 @@ describe("EditorGroupTabBar behavior", () => {
setActivePinia(pinia);
});
it("offers duplicate without rename on a data tab", async () => {
const store = useQueryStore();
const id = store.createTab("pg-1", "app", "users", "data", "public");
const { app, host } = mountBar(store.groups[0].id, [id], id, pinia);
await settle();
const menu = JSON.parse(host.querySelector<HTMLElement>("[data-menu-items]")!.dataset.menuItems!);
expect(menu).toContainEqual(expect.objectContaining({ label: "Duplicate", visible: true }));
expect(menu).not.toContainEqual(expect.objectContaining({ label: "Rename" }));
app.unmount();
host.remove();
});
it("activates a tab on plain click", async () => {
const store = useQueryStore();
const firstId = store.createTab("pg-1", "app", "Query 1", "query");