mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: move snippets, keybinding actions and macros out of core into plugins
This commit is contained in:
1 parent
d9bba10612
commit
e0c30a4e6f
262 files changed
+9091
-10744
No files matched your search
@@ -98,6 +98,28 @@ describe("snippets activate", () => {
|
||||
expect(after).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("registers its host settings hooks and the variables helper", async () => {
|
||||
server = await startServer();
|
||||
const registry = server.mock.ctx.registry;
|
||||
for (const key of [
|
||||
"snippets.hostImportNormalizer",
|
||||
"snippets.hostPayloadLegacy",
|
||||
"snippets.hostSettingsSync",
|
||||
]) {
|
||||
expect(registry.consume(key), key).toBeDefined();
|
||||
}
|
||||
const variables = registry.consume<{
|
||||
resolve: (c: string, h: { ip?: string } | null) => string;
|
||||
extractInputs: (c: string) => Array<{ key: string }>;
|
||||
}>("snippets.variables");
|
||||
expect(variables?.resolve("ping $HOST", { ip: "10.0.0.1" })).toBe(
|
||||
"ping 10.0.0.1",
|
||||
);
|
||||
expect(variables?.extractInputs("echo $INPUT_1")).toEqual([
|
||||
{ key: "INPUT_1", label: "Input 1" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("fails closed without db:own", async () => {
|
||||
db = await createTestDb(pluginDir);
|
||||
const mock = createMockCtx({
|
||||
|
||||
Reference in new issue
Block a user