Update for standalone base environments

This commit is contained in:
Gregory Schier
2025-01-13 17:04:35 -08:00
parent f8b211be1c
commit a80a25a90e
11 changed files with 495 additions and 51 deletions

View File

@@ -30,4 +30,46 @@ describe('importer-yaak', () => {
}),
);
});
test('converts schema 2 to 3', () => {
const imported = pluginHookImport(
ctx,
JSON.stringify({
yaakSchema: 2,
resources: {
environments: [{
id: 'e_1',
workspaceId: 'w_1',
name: 'Production',
variables: [{ name: 'E1', value: 'E1!' }],
}],
workspaces: [{
id: 'w_1',
variables: [{ name: 'W1', value: 'W1!' }],
}],
},
}),
);
expect(imported).toEqual(
expect.objectContaining({
resources: {
workspaces: [{
id: 'w_1',
}],
environments: [{
id: 'e_1',
environmentId: 'GENERATE_ID::base_env_w_1',
workspaceId: 'w_1',
name: 'Production',
variables: [{ name: 'E1', value: 'E1!' }],
}, {
id: 'GENERATE_ID::base_env_w_1',
workspaceId: 'w_1',
name: 'Global Variables',
variables: [{ name: 'W1', value: 'W1!' }],
}],
},
}),
);
});
});