~dandrader/unity-api/lifecycle

« back to all changes in this revision

Viewing changes to test/qmltest/unity/shell/scopes/tst_Scopes.qml

  • Committer: CI bot
  • Author(s): Michal Hruby, Albert Astals
  • Date: 2014-06-16 14:45:00 UTC
  • mfrom: (134.3.11 departments)
  • Revision ID: ps-jenkins@lists.canonical.com-20140616144500-xcnt2u2onjgu26si
Add Departments interfaces
 Fixes: 1320847

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    }
29
29
    property var scope: scopes.getScope(0)
30
30
    property var preview: root.scope.preview("")
 
31
    property var department: root.scope.getDepartment("root")
31
32
 
32
33
    Verifier {
33
34
        id: scopesVerifier
123
124
                { tag: "Item.properties[searchQuery]", constant: "searchQuery", type: "string" },
124
125
                { tag: "Item.properties[noResultsHint]", constant: "noResultsHint", type: "string" },
125
126
                { tag: "Item.properties[formFactor]", constant: "formFactor", type: "string" },
126
 
                { tag: "Item.properties[isActive]", constant: "isActive", type: "boolean" }
 
127
                { tag: "Item.properties[isActive]", constant: "isActive", type: "boolean" },
 
128
                { tag: "Item.properties[currentDepartmentId]", constant: "currentDepartmentId", type: "string" },
 
129
                { tag: "Item.properties[hasDepartments]", constant: "hasDepartments", type: "boolean" }
127
130
            ];
128
131
        }
129
132
 
145
148
                { tag: "Model.methods[previewRequested]", method: "previewRequested" },
146
149
                { tag: "Model.methods[gotoScope]", method: "gotoScope" },
147
150
                { tag: "Model.methods[openScope]", method: "openScope" },
148
 
                { tag: "Model.methods[activateApplication]", method: "activateApplication" }
 
151
                { tag: "Model.methods[activateApplication]", method: "activateApplication" },
 
152
                { tag: "Model.methods[getDepartment]", method: "getDepartment" },
 
153
                { tag: "Model.methods[loadDepartment]", method: "loadDepartment" }
149
154
            ];
150
155
        }
151
156
 
438
443
            verifyData(data);
439
444
        }
440
445
    }
 
446
 
 
447
 
 
448
    Verifier {
 
449
        id: departmentVerifier
 
450
 
 
451
        Repeater {
 
452
             id: departmentRepeater
 
453
             model: root.department
 
454
             delegate: Item {
 
455
                 property var roles: model
 
456
             }
 
457
        }
 
458
 
 
459
        function test_department_data() {
 
460
            return [
 
461
                { tag: "Department[object]", type: "object" },
 
462
                { tag: "Department[DepartmentInterface]", type: "unity::shell::scopes::DepartmentInterface" },
 
463
            ];
 
464
        }
 
465
 
 
466
        function test_department(data) {
 
467
            object = departmentRepeater.model;
 
468
            name = "Department";
 
469
            verifyData(data);
 
470
        }
 
471
 
 
472
        function test_department_roles_data() {
 
473
            return [
 
474
                { tag: "Model.roles[departmentId]", role: "departmentId", type: "string" },
 
475
                { tag: "Model.roles[label]", role: "label", type: "string" },
 
476
                { tag: "Model.roles[hasChildren]", role: "hasChildren", type: "boolean" },
 
477
                { tag: "Model.roles[isActive]", role: "isActive", type: "boolean" }
 
478
            ];
 
479
        }
 
480
 
 
481
        function test_department_roles(data) {
 
482
            object = departmentRepeater.itemAt(0).roles;
 
483
            name = "Department";
 
484
            verifyData(data);
 
485
        }
 
486
 
 
487
        function test_department_properties_data() {
 
488
            return [
 
489
                { tag: "Model.properties[departmentId]", constant: "departmentId", type: "string" },
 
490
                { tag: "Model.properties[label]", constant: "label", type: "string" },
 
491
                { tag: "Model.properties[allLabel]", constant: "allLabel", type: "string" },
 
492
                { tag: "Model.properties[parentDepartmentId]", constant: "parentDepartmentId", type: "string" },
 
493
                { tag: "Model.properties[parentLabel]", constant: "parentLabel", type: "string" },
 
494
                { tag: "Model.properties[loaded]", constant: "loaded", type: "boolean" },
 
495
                { tag: "Model.properties[isRoot]", constant: "isRoot", type: "boolean" },
 
496
                { tag: "Model.properties[count]", constant: "count", type: "number" }
 
497
            ];
 
498
        }
 
499
 
 
500
        function test_department_properties(data) {
 
501
            object = departmentRepeater.model;
 
502
            name = "Department";
 
503
            verifyData(data);
 
504
        }
 
505
    }
441
506
}