mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-09-09 19:31:57 +02:00
feat(import): add stable per-resource source keys to the importer contract (#614)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e63a87718c
commit
81a2a5d955
@@ -148,4 +148,32 @@ describe("importer-yaak", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
test("Keys models by their Yaak ID, unchanged by a rename", () => {
|
||||
const exported = (requestName: string) =>
|
||||
JSON.stringify({
|
||||
yaakSchema: 5,
|
||||
resources: {
|
||||
workspaces: [{ id: "wk_1", model: "workspace", name: "Keys" }],
|
||||
httpRequests: [
|
||||
{
|
||||
id: "rq_1",
|
||||
model: "http_request",
|
||||
workspaceId: "wk_1",
|
||||
name: requestName,
|
||||
url: "https://yaak.app",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
expect(migrateImport(exported("Original"))?.sourceKeys).toEqual({
|
||||
wk_1: "wk_1",
|
||||
rq_1: "rq_1",
|
||||
});
|
||||
expect(migrateImport(exported("Renamed"))?.sourceKeys).toEqual({
|
||||
wk_1: "wk_1",
|
||||
rq_1: "rq_1",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user