mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: proxmox guest sync, startup snippet sync, drop dead cloudflare ssh transport
This commit is contained in:
1 parent
44062e30d1
commit
ffa872ebd3
19 files changed
+270
-292
No files matched your search
@@ -35,6 +35,7 @@ beforeEach(() => {
|
||||
references: [
|
||||
{ field: "parentId", syncField: "parentSyncId", entityType: "things" },
|
||||
{ field: "hops[].thingId", entityType: "things" },
|
||||
{ field: "config.startId", entityType: "things" },
|
||||
{
|
||||
field: "bindings[].action.snippetId",
|
||||
entityType: "things",
|
||||
@@ -111,6 +112,29 @@ describe("serializing references", () => {
|
||||
expect(back.bindings).toEqual([{ action: { snippetId: "12" } }]);
|
||||
});
|
||||
|
||||
it("rewrites an id nested in a JSON object column", async () => {
|
||||
const wire = await serializeReferences(
|
||||
entity("things"),
|
||||
{ config: JSON.stringify({ theme: "dark", startId: 5 }) },
|
||||
toSync,
|
||||
);
|
||||
expect(JSON.parse(wire.config as string)).toEqual({
|
||||
theme: "dark",
|
||||
startId: "sync-5",
|
||||
});
|
||||
|
||||
const back = await deserializeReferences(
|
||||
entity("things"),
|
||||
wire,
|
||||
toId,
|
||||
null,
|
||||
);
|
||||
expect(JSON.parse(back.config as string)).toEqual({
|
||||
theme: "dark",
|
||||
startId: 5,
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps the current value when a referenced row is not here", async () => {
|
||||
const back = await deserializeReferences(
|
||||
entity("things"),
|
||||
|
||||
Reference in new issue
Block a user