ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / build / lib / test / stringEnumPolicy.test.ts 186 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import assert from 'assert' ;
import { suite, test } from 'node:test' ;
import { StringEnumPolicy } from '../policies/stringEnumPolicy.ts' ;
import { PolicyType, type LanguageTranslations } from '../policies/types.ts' ;
import type { CategoryDto, PolicyDto } from '../policies/policyDto.ts' ;
suite ( 'StringEnumPolicy' , ( ) => {
const mockCategory: CategoryDto = {
key: 'test.category'
name value key
mockPolicy PolicyDto
key
name
category
minimumVersion
type
localization
description key value
enumDescriptions
key value
key value
key value
policy StringEnumPolicy mockCategory mockPolicy
assert policy
assert policy name
assert policy minimumVersion
assert policy category name nlsKey mockCategory name key
assert policy category name value mockCategory name value
assert policy type PolicyType StringEnum
policy StringEnumPolicy mockCategory mockPolicy
assert policy
admx policy
assert admx
policy StringEnumPolicy mockCategory mockPolicy
assert policy
admlStrings policy
assert admlStrings
policy StringEnumPolicy mockCategory mockPolicy
assert policy
translations LanguageTranslations
admlStrings policy translations
assert admlStrings
policy StringEnumPolicy mockCategory mockPolicy
assert policy
presentation policy
assert presentation
policy StringEnumPolicy mockCategory mockPolicy
assert policy
jsonValue policy
assert jsonValue
policy StringEnumPolicy mockCategory mockPolicy
assert policy
profileValue policy
assert profileValue
policy StringEnumPolicy mockCategory mockPolicy
assert policy
profile policy
assert profile length
assert profile
assert profile
policy StringEnumPolicy mockCategory mockPolicy
assert policy
manifestValue policy
assert manifestValue
policy StringEnumPolicy mockCategory mockPolicy
assert policy
translations LanguageTranslations
manifestValue policy translations
assert manifestValue
policy StringEnumPolicy mockCategory mockPolicy
assert policy
manifest policy
assert manifest
,
:
{
:
'Category1'
,
:
'test.category'
}
,
}
;
const
:
=
{
:
'test.stringenum.policy'
,
:
'TestStringEnumPolicy'
,
:
'Category1'
,
:
'1.0'
,
:
'string'
,
:
{
:
{
:
'test.policy.description'
,
:
'Test policy description'
}
,
:
[
{
:
'test.option.one'
,
:
'Option One'
}
,
{
:
'test.option.two'
,
:
'Option Two'
}
,
{
:
'test.option.three'
,
:
'Option Three'
}
]
}
,
enum
:
[
'auto'
,
'manual'
,
'disabled'
]
}
;
test
(
'should create StringEnumPolicy from factory method'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
.
strictEqual
(
.
,
'TestStringEnumPolicy'
)
;
.
strictEqual
(
.
,
'1.0'
)
;
.
strictEqual
(
.
.
.
,
.
.
)
;
.
strictEqual
(
.
.
.
,
.
.
)
;
.
strictEqual
(
.
,
.
)
;
}
)
;
test
(
'should render ADMX elements correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderADMX
(
'TestKey'
)
;
.
deepStrictEqual
(
,
[
'<policy name="TestStringEnumPolicy" class="Both" displayName="$(string.TestStringEnumPolicy)" explainText="$(string.TestStringEnumPolicy_test_policy_description)" key="Software\\Policies\\Microsoft\\TestKey" presentation="$(presentation.TestStringEnumPolicy)">'
,
'\t<parentCategory ref="test.category" />'
,
'\t<supportedOn ref="Supported_1_0" />'
,
'\t<elements>'
,
'<enum id="TestStringEnumPolicy" valueName="TestStringEnumPolicy">'
,
'\t<item displayName="$(string.TestStringEnumPolicy_test_option_one)"><value><string>auto</string></value></item>'
,
'\t<item displayName="$(string.TestStringEnumPolicy_test_option_two)"><value><string>manual</string></value></item>'
,
'\t<item displayName="$(string.TestStringEnumPolicy_test_option_three)"><value><string>disabled</string></value></item>'
,
'</enum>'
,
'\t</elements>'
,
'</policy>'
]
)
;
}
)
;
test
(
'should render ADML strings correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderADMLStrings
(
)
;
.
deepStrictEqual
(
,
[
'<string id="TestStringEnumPolicy">TestStringEnumPolicy</string>'
,
'<string id="TestStringEnumPolicy_test_policy_description">Test policy description</string>'
,
'<string id="TestStringEnumPolicy_test_option_one">Option One</string>'
,
'<string id="TestStringEnumPolicy_test_option_two">Option Two</string>'
,
'<string id="TestStringEnumPolicy_test_option_three">Option Three</string>'
]
)
;
}
)
;
test
(
'should render ADML strings with translations'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
:
=
{
''
:
{
'test.policy.description'
:
'Translated description'
,
'test.option.one'
:
'Translated Option One'
,
'test.option.two'
:
'Translated Option Two'
}
}
;
const
=
.
renderADMLStrings
(
)
;
.
deepStrictEqual
(
,
[
'<string id="TestStringEnumPolicy">TestStringEnumPolicy</string>'
,
'<string id="TestStringEnumPolicy_test_policy_description">Translated description</string>'
,
'<string id="TestStringEnumPolicy_test_option_one">Translated Option One</string>'
,
'<string id="TestStringEnumPolicy_test_option_two">Translated Option Two</string>'
,
'<string id="TestStringEnumPolicy_test_option_three">Option Three</string>'
]
)
;
}
)
;
test
(
'should render ADML presentation correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderADMLPresentation
(
)
;
.
strictEqual
(
,
'<presentation id="TestStringEnumPolicy"><dropdownList refId="TestStringEnumPolicy" /></presentation>'
)
;
}
)
;
test
(
'should render JSON value correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderJsonValue
(
)
;
.
strictEqual
(
,
'auto'
)
;
}
)
;
test
(
'should render profile value correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfileValue
(
)
;
.
strictEqual
(
,
'<string>auto</string>'
)
;
}
)
;
test
(
'should render profile correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfile
(
)
;
.
strictEqual
(
.
,
2
)
;
.
strictEqual
(
[
0
]
,
'<key>TestStringEnumPolicy</key>'
)
;
.
strictEqual
(
[
1
]
,
'<string>auto</string>'
)
;
}
)
;
test
(
'should render profile manifest value correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfileManifestValue
(
)
;
.
strictEqual
(
,
'<key>pfm_default</key>\n<string>auto</string>\n<key>pfm_description</key>\n<string>Test policy description</string>\n<key>pfm_name</key>\n<string>TestStringEnumPolicy</string>\n<key>pfm_title</key>\n<string>TestStringEnumPolicy</string>\n<key>pfm_type</key>\n<string>string</string>\n<key>pfm_range_list</key>\n<array>\n\t<string>auto</string>\n\t<string>manual</string>\n\t<string>disabled</string>\n</array>'
)
;
}
)
;
test
(
'should render profile manifest value with translations'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
:
=
{
''
:
{
'test.policy.description'
:
'Translated manifest description'
}
}
;
const
=
.
renderProfileManifestValue
(
)
;
.
strictEqual
(
,
'<key>pfm_default</key>\n<string>auto</string>\n<key>pfm_description</key>\n<string>Translated manifest description</string>\n<key>pfm_name</key>\n<string>TestStringEnumPolicy</string>\n<key>pfm_title</key>\n<string>TestStringEnumPolicy</string>\n<key>pfm_type</key>\n<string>string</string>\n<key>pfm_range_list</key>\n<array>\n\t<string>auto</string>\n\t<string>manual</string>\n\t<string>disabled</string>\n</array>'
)
;
}
)
;
test
(
'should render profile manifest correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfileManifest
(
)
;
.
strictEqual
(
,
'<dict>\n<key>pfm_default</key>\n<string>auto</string>\n<key>pfm_description</key>\n<string>Test policy description</string>\n<key>pfm_name</key>\n<string>TestStringEnumPolicy</string>\n<key>pfm_title</key>\n<string>TestStringEnumPolicy</string>\n<key>pfm_type</key>\n<string>string</string>\n<key>pfm_range_list</key>\n<array>\n\t<string>auto</string>\n\t<string>manual</string>\n\t<string>disabled</string>\n</array>\n</dict>'
)
;
}
)
;
}
)
;