Use findChild to test role names in models

Bug #1215818 reported by Cris Dywan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
U1DB Qt/ QML
Confirmed
Low
Unassigned

Bug Description

The unit tests for the model are incomplete in particular when it comes to testing role names because at the time I didn't find a way to properly retrieve values from delegates. I've learnt about a method we can use:

import Ubuntu.Test 0.1

UbuntuTestCase {
    when: windowShown

ListView {
    delegate: Item {
    objectName: "roleItem"
    property bool roleEnabled: model.enabled

test_modelRoles () {
    verify(testModel.count > 0, "alarm added");
    var item = findChild(roleTest, "roleItem");
    verify(item, "has children");
    verify(item.roleEnabled !== undefined, "enabled is defined");
}

Cris Dywan (kalikiana)
Changed in u1db-qt:
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.