ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / build / lib / test / numberPolicy.test.ts 169 строк · изменён 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
import assert from 'assert' ;
import { suite, test } from 'node:test' ;
import { NumberPolicy } from '../policies/numberPolicy.ts' ;
import { type LanguageTranslations , PolicyType } from '../policies/types.ts' ;
import type { CategoryDto, PolicyDto } from '../policies/policyDto.ts' ;
suite ( 'NumberPolicy' , ( ) => {
const mockCategory: CategoryDto = {
key: 'test.category'
name value key
mockPolicy PolicyDto
key
name
category
minimumVersion
type
localization
description key value
policy NumberPolicy 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 Number
policy NumberPolicy mockCategory mockPolicy
assert policy
admx policy
assert admx
policy NumberPolicy mockCategory mockPolicy
assert policy
admlStrings policy
assert admlStrings
policy NumberPolicy mockCategory mockPolicy
assert policy
translations LanguageTranslations
admlStrings policy translations
assert admlStrings
policy NumberPolicy mockCategory mockPolicy
assert policy
presentation policy
assert presentation
policy NumberPolicy mockCategory mockPolicy
assert policy
jsonValue policy
assert jsonValue
policy NumberPolicy mockCategory mockPolicy
assert policy
profileValue policy
assert profileValue
policy NumberPolicy mockCategory mockPolicy
assert policy
profile policy
assert profile length
assert profile
assert profile
policy NumberPolicy mockCategory mockPolicy
assert policy
manifestValue policy
assert manifestValue
policy NumberPolicy mockCategory mockPolicy
assert policy
translations LanguageTranslations
manifestValue policy translations
assert manifestValue
policy NumberPolicy mockCategory mockPolicy
assert policy
manifest policy
assert manifest
,
:
{
:
'Category1'
,
:
'test.category'
}
,
}
;
const
:
=
{
:
'test.number.policy'
,
:
'TestNumberPolicy'
,
:
'Category1'
,
:
'1.0'
,
:
'number'
,
default
:
42
,
:
{
:
{
:
'test.policy.description'
,
:
'Test number policy description'
}
}
}
;
test
(
'should create NumberPolicy from factory method'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
.
strictEqual
(
.
,
'TestNumberPolicy'
)
;
.
strictEqual
(
.
,
'1.0'
)
;
.
strictEqual
(
.
.
.
,
.
.
)
;
.
strictEqual
(
.
.
.
,
.
.
)
;
.
strictEqual
(
.
,
.
)
;
}
)
;
test
(
'should render ADMX elements correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderADMX
(
'TestKey'
)
;
.
deepStrictEqual
(
,
[
'<policy name="TestNumberPolicy" class="Both" displayName="$(string.TestNumberPolicy)" explainText="$(string.TestNumberPolicy_test_policy_description)" key="Software\\Policies\\Microsoft\\TestKey" presentation="$(presentation.TestNumberPolicy)">'
,
'\t<parentCategory ref="test.category" />'
,
'\t<supportedOn ref="Supported_1_0" />'
,
'\t<elements>'
,
'<decimal id="TestNumberPolicy" valueName="TestNumberPolicy" />'
,
'\t</elements>'
,
'</policy>'
]
)
;
}
)
;
test
(
'should render ADML strings correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderADMLStrings
(
)
;
.
deepStrictEqual
(
,
[
'<string id="TestNumberPolicy">TestNumberPolicy</string>'
,
'<string id="TestNumberPolicy_test_policy_description">Test number policy description</string>'
]
)
;
}
)
;
test
(
'should render ADML strings with translations'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
:
=
{
''
:
{
'test.policy.description'
:
'Translated description'
}
}
;
const
=
.
renderADMLStrings
(
)
;
.
deepStrictEqual
(
,
[
'<string id="TestNumberPolicy">TestNumberPolicy</string>'
,
'<string id="TestNumberPolicy_test_policy_description">Translated description</string>'
]
)
;
}
)
;
test
(
'should render ADML presentation correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderADMLPresentation
(
)
;
.
strictEqual
(
,
'<presentation id="TestNumberPolicy"><decimalTextBox refId="TestNumberPolicy" defaultValue="42">TestNumberPolicy</decimalTextBox></presentation>'
)
;
}
)
;
test
(
'should render JSON value correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderJsonValue
(
)
;
.
strictEqual
(
,
42
)
;
}
)
;
test
(
'should render profile value correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfileValue
(
)
;
.
strictEqual
(
,
'<integer>42</integer>'
)
;
}
)
;
test
(
'should render profile correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfile
(
)
;
.
strictEqual
(
.
,
2
)
;
.
strictEqual
(
[
0
]
,
'<key>TestNumberPolicy</key>'
)
;
.
strictEqual
(
[
1
]
,
'<integer>42</integer>'
)
;
}
)
;
test
(
'should render profile manifest value correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfileManifestValue
(
)
;
.
strictEqual
(
,
'<key>pfm_default</key>\n<integer>42</integer>\n<key>pfm_description</key>\n<string>Test number policy description</string>\n<key>pfm_name</key>\n<string>TestNumberPolicy</string>\n<key>pfm_title</key>\n<string>TestNumberPolicy</string>\n<key>pfm_type</key>\n<string>integer</string>'
)
;
}
)
;
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<integer>42</integer>\n<key>pfm_description</key>\n<string>Translated manifest description</string>\n<key>pfm_name</key>\n<string>TestNumberPolicy</string>\n<key>pfm_title</key>\n<string>TestNumberPolicy</string>\n<key>pfm_type</key>\n<string>integer</string>'
)
;
}
)
;
test
(
'should render profile manifest correctly'
,
(
)
=>
{
const
=
.
from
(
,
)
;
.
ok
(
)
;
const
=
.
renderProfileManifest
(
)
;
.
strictEqual
(
,
'<dict>\n<key>pfm_default</key>\n<integer>42</integer>\n<key>pfm_description</key>\n<string>Test number policy description</string>\n<key>pfm_name</key>\n<string>TestNumberPolicy</string>\n<key>pfm_title</key>\n<string>TestNumberPolicy</string>\n<key>pfm_type</key>\n<string>integer</string>\n</dict>'
)
;
}
)
;
}
)
;