Fix up so manifestParser can deserialize new property "supportsReadOnly"

This commit is contained in:
Zeegaan
2022-07-05 08:41:55 +02:00
parent a572044f9e
commit a3bcc99ed0
3 changed files with 69 additions and 0 deletions

View File

@@ -505,4 +505,61 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2
Assert.IsFalse(manifest.AllowPackageTelemetry);
}
[Test]
public void CanParseManifest_ParameterEditors_SupportsReadOnly()
{
const string json = @"{'parameterEditors': [
{
alias: 'parameter1',
name: 'My Parameter',
view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html',
supportsReadOnly: true
}]}";
var manifest = _parser.ParseManifest(json);
Assert.IsTrue(manifest.ParameterEditors.FirstOrDefault().SupportsReadOnly);
}
[Test]
public void CanParseManifest_PropertyEditors_SupportsReadOnly()
{
const string json = @"{'propertyEditors': [
{
alias: 'Test.Test1',
name: 'Test 1',
supportsReadOnly: true,
editor: {
view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html',
valueType: 'int',
hideLabel: true,
validation: {
'required': true,
'Regex': '\\d*'
}
},
prevalues: {
fields: [
{
label: 'Some config 1',
key: 'key1',
view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val1.html',
validation: {
required: true
}
},
{
label: 'Some config 2',
key: 'key2',
view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val2.html'
}
]
}
}]}";
var manifest = _parser.ParseManifest(json);
Assert.IsTrue(manifest.PropertyEditors.FirstOrDefault().SupportsReadOnly);
}
}