mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Add policy support for linux (#272579)
This commit is contained in:
@@ -13,7 +13,7 @@ import { ObjectPolicy } from '../policies/objectPolicy';
|
||||
import { StringEnumPolicy } from '../policies/stringEnumPolicy';
|
||||
import { StringPolicy } from '../policies/stringPolicy';
|
||||
import { Policy, ProductJson } from '../policies/types';
|
||||
import { renderGP, renderMacOSPolicy } from '../policies/render';
|
||||
import { renderGP, renderMacOSPolicy, renderJsonPolicies } from '../policies/render';
|
||||
|
||||
const PolicyTypes = [
|
||||
BooleanPolicy,
|
||||
@@ -492,4 +492,17 @@ suite('Policy E2E conversion', () => {
|
||||
assert.strictEqual(frFrAdml.contents, expectedContent, 'Windows fr-fr ADML should match the fixture');
|
||||
});
|
||||
|
||||
test('should render Linux policy JSON from policies list', async () => {
|
||||
const parsedPolicies = parsePolicies(policies);
|
||||
const result = renderJsonPolicies(parsedPolicies);
|
||||
|
||||
// Load the expected fixture file
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'policies', 'linux', 'policy.json');
|
||||
const expectedContent = await fs.readFile(fixturePath, 'utf-8');
|
||||
const expectedJson = JSON.parse(expectedContent);
|
||||
|
||||
// Compare the rendered JSON with the fixture
|
||||
assert.deepStrictEqual(result, expectedJson, 'Linux policy JSON should match the fixture');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user