summaryrefslogtreecommitdiffstats
path: root/install/static/test
diff options
context:
space:
mode:
Diffstat (limited to 'install/static/test')
-rw-r--r--install/static/test/data/json_metadata.json25
-rw-r--r--install/static/test/data/service_mod.json21
-rw-r--r--install/static/test/data/service_show.json5
-rw-r--r--install/static/test/details_tests.js83
4 files changed, 101 insertions, 33 deletions
diff --git a/install/static/test/data/json_metadata.json b/install/static/test/data/json_metadata.json
index 52be79882..4a732ac5f 100644
--- a/install/static/test/data/json_metadata.json
+++ b/install/static/test/data/json_metadata.json
@@ -2865,6 +2865,31 @@
"query": false,
"required": true,
"type": "unicode"
+ },
+ {
+ "attribute": false,
+ "autofill": false,
+ "class": "Bytes",
+ "cli_name": "certificate",
+ "cli_short_name": null,
+ "default": null,
+ "doc": "Base-64 encoded server certificate",
+ "exclude": null,
+ "flags": [],
+ "hint": null,
+ "include": null,
+ "label": "Certificate",
+ "length": null,
+ "maxlength": null,
+ "minlength": null,
+ "multivalue": false,
+ "name": "usercertificate",
+ "pattern": null,
+ "pattern_errmsg": null,
+ "primary_key": false,
+ "query": false,
+ "required": false,
+ "type": "str"
}
],
"uuid_attribute": "ipauniqueid"
diff --git a/install/static/test/data/service_mod.json b/install/static/test/data/service_mod.json
new file mode 100644
index 000000000..f56186466
--- /dev/null
+++ b/install/static/test/data/service_mod.json
@@ -0,0 +1,21 @@
+{
+ "error": null,
+ "id": 0,
+ "result": {
+ "result": {
+ "krbprincipalname": [
+ "test/dev.example.com@DEV.EXAMPLE.COM"
+ ],
+ "managedby_host": [
+ "dev.example.com"
+ ],
+ "usercertificate": [
+ {
+ "__base64__": "MIICAjCCAWugAwIBAgICBAswDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTAwNzIzMzk0NFoXDTE1MTAwNzIzMzk0NFowKDEMMAoGA1UECgwDSVBBMRgwFgYDVQQDDA9kZXYuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOTXyj8grVB7Rj95RFawgdwn9OYZ03LWHZ+HMYggu2/xCCrUrdThP14YBlVqZumjVJSclj6T4ACjjdPJq9JTTmx7gMizDTReus7IPlS6fCxb5v5whQJZsEksXL04OxUMl25euPRFkYcTK1rdW47+AkG10j1qeNW+B6CpdQGR6eM/AgMBAAGjOjA4MBEGCWCGSAGG+EIBAQQEAwIGQDATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADgYEASIhq723VL5xP0q51MYXFlGU1boD7pPD1pIQspD/MjCIEupcbH2kAo4wf+EiKsXR0rs+WZkaSgvFqaM4OQ2kWSFTiqmFXFDBEi6EFr68yLg7IpQpNTzVBXERd8B4GwNL9wrRw60jPXlUK29DPBsdGq8fDgX18l39wKkWXv7p1to4="
+ }
+ ]
+ },
+ "summary": "Modified service \"test/dev.example.com@DEV.EXAMPLE.COM\"",
+ "value": "test/dev.example.com@DEV.EXAMPLE.COM"
+ }
+} \ No newline at end of file
diff --git a/install/static/test/data/service_show.json b/install/static/test/data/service_show.json
index 30025eb76..7ab778e18 100644
--- a/install/static/test/data/service_show.json
+++ b/install/static/test/data/service_show.json
@@ -10,6 +10,11 @@
],
"managedby_host": [
"dev.example.com"
+ ],
+ "usercertificate": [
+ {
+ "__base64__": "MIICAjCCAWugAwIBAgICBAswDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTAwNzIzMzk0NFoXDTE1MTAwNzIzMzk0NFowKDEMMAoGA1UECgwDSVBBMRgwFgYDVQQDDA9kZXYuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOTXyj8grVB7Rj95RFawgdwn9OYZ03LWHZ+HMYggu2/xCCrUrdThP14YBlVqZumjVJSclj6T4ACjjdPJq9JTTmx7gMizDTReus7IPlS6fCxb5v5whQJZsEksXL04OxUMl25euPRFkYcTK1rdW47+AkG10j1qeNW+B6CpdQGR6eM/AgMBAAGjOjA4MBEGCWCGSAGG+EIBAQQEAwIGQDATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADgYEASIhq723VL5xP0q51MYXFlGU1boD7pPD1pIQspD/MjCIEupcbH2kAo4wf+EiKsXR0rs+WZkaSgvFqaM4OQ2kWSFTiqmFXFDBEi6EFr68yLg7IpQpNTzVBXERd8B4GwNL9wrRw60jPXlUK29DPBsdGq8fDgX18l39wKkWXv7p1to4="
+ }
]
},
"summary": null,
diff --git a/install/static/test/details_tests.js b/install/static/test/details_tests.js
index ee5d3961e..1a7efc10b 100644
--- a/install/static/test/details_tests.js
+++ b/install/static/test/details_tests.js
@@ -22,26 +22,37 @@
test("Testing ipa_details_create().", function() {
- var details = [
- ['identity', 'Entity Details', [
- ['cn', 'Entity Name'],
- ['description', 'Description'],
- ['number', 'Entity ID']
- ]]
+ var fields = [
+ {name:'cn', label:'Entity Name'},
+ {name:'description', label:'Description'},
+ {name:'number', label:'Entity ID'}
];
- var identity = details[0];
- var attrs=identity[2];
+ var sections = [
+ {name:'identity', label:'Entity Details', fields:fields}
+ ];
+
+ var identity = sections[0];
var key = 'entity';
- var container = $("<div/>",{id: "container"});
- ipa_details_create(key, details, container)
+ var container = $("<div/>",{id: key});
+ ipa_details_create(container, sections);
- same(container[0].title,key);
+ same(
+ container[0].title, key,
+ "Checking container name"
+ );
+
var dl = container.find('dl#identity');
- ok(dl );
+ ok(
+ dl,
+ "Checking section"
+ );
- same(dl[0].children.length, attrs.length);
+ same(
+ dl[0].children.length, fields.length,
+ "Checking fields"
+ );
});
@@ -60,33 +71,39 @@ test("Testing _ipa_create_text_input().", function(){
-test("Testing ipa_generate_dl()",function(){
+test("Testing ipa_details_section_setup()",function(){
- var details = [
- ['cn', 'Entity Name'],
- ['description', 'Description'],
- ['number', 'Entity ID']
+ var fields = [
+ {name:'cn', label:'Entity Name'},
+ {name:'description', label:'Description'},
+ {name:'number', label:'Entity ID'}
];
- var name = 'NAMENAMENAME';
- var identity = 'IDIDID';
- var parent = $("<div/>");
- var jobj = $("<div title='entity'/>");
- parent.append(jobj);
- ipa_generate_dl(jobj, identity,name, details);
- ok(parent.find('hr'));
+ var section = {
+ name: 'IDIDID',
+ label: 'NAMENAMENAME',
+ fields: fields
+ };
+
+ var container = $("<div title='entity'/>");
+ var details = $("<div/>");
+ container.append(details);
+
+ ipa_details_section_setup(container, details, section);
+
+ ok(container.find('hr'));
- var h2= parent.find('h2');
+ var h2= container.find('h2');
ok(h2);
- ok(h2[0].innerHTML.indexOf(name) > 1,"find name in html");
+ ok(h2[0].innerHTML.indexOf(section.label) > 1,"find name in html");
- var dl = parent.find('dl');
+ var dl = container.find('dl');
ok(dl);
same(dl[0].children.length,3);
- same(dl[0].id, identity);
- same(dl[0].children[0].title,details[0][0]);
- same(dl[0].children[0].innerHTML,details[0][1]+":");
- same(dl[0].children[2].title,details[2][0]);
- same(dl[0].children[2].innerHTML,details[2][1]+":");
+ same(dl[0].id, section.name);
+ same(dl[0].children[0].title, fields[0].name);
+ same(dl[0].children[0].innerHTML, fields[0].label+":");
+ same(dl[0].children[2].title, fields[2].name);
+ same(dl[0].children[2].innerHTML, fields[2].label+":");
}); \ No newline at end of file