mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
feat(ssh-terminal): add a duplicate tab action (#1510)
This commit is contained in:
1 parent
55d7c8837b
commit
fef33142b3
4 files changed
+55
-2
No files matched your search
@@ -63,6 +63,36 @@ describe(`${manifest.id} activate`, () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("duplicates only the SSH connection configuration into a fresh tab", async () => {
|
||||
rendered = await renderWithApp(plugin, { manifest, locales });
|
||||
const host = { id: 7, name: "server", ip: "192.0.2.1", port: 22 };
|
||||
expect(rendered.registered.slot("tab.menu")).toContain(
|
||||
"terminal.duplicateTab",
|
||||
);
|
||||
await rendered.app.invokeAction("terminal.duplicateTab", undefined, {
|
||||
id: "old-tab",
|
||||
type: "terminal",
|
||||
host,
|
||||
instanceId: "old-instance",
|
||||
data: { initialPath: "/tmp", joinSharedSessionId: "shared-session" },
|
||||
});
|
||||
expect(rendered.shellCalls).toEqual([
|
||||
{
|
||||
method: "openTab",
|
||||
args: [
|
||||
{ ...host, pluginSettings: {} },
|
||||
"terminal",
|
||||
{ forceNewTab: true },
|
||||
],
|
||||
},
|
||||
]);
|
||||
await rendered.app.invokeAction("terminal.duplicateTab", undefined, {
|
||||
id: "local",
|
||||
type: "local-terminal",
|
||||
});
|
||||
expect(rendered.shellCalls).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("owns the host editor's Terminal tab in the SSH group", async () => {
|
||||
rendered = await renderWithApp(plugin, { manifest, locales });
|
||||
expect(rendered.registered.hostEditorSections()).toEqual(["terminal"]);
|
||||
|
||||
Reference in new issue
Block a user