PowerTuneDigital / PowerTuneDigitalOfficial

Official PowerTune Digital Repo
GNU General Public License v3.0
18 stars 7 forks source link

Refactored dash selection #16

Closed pgrandin closed 2 years ago

pgrandin commented 2 years ago

A few changes are included in this PR:

Item { width: 800; height: 480

DashSelector {
    id: dash_selector
    anchors.centerIn: parent
}

TestCase {
    name: "TestDashConfig"; when: windowShown

    function test_mapping_function(){
        verify(dash_selector.getDashByIndex(1) === "qrc:/Gauges/GPS.qml")
    }

    function test_dashselection() {    
        var settings = findChild(dash_selector, "settings1")        
        var number_of_dashes = settings.numberofdash
        verify(number_of_dashes == -1, "No dash defined")
    }

    function test_adding_dash() {
        var dash1 = findChild(dash_selector, "dash1")
        compare(dash1.text, undefined)

        // We should probably use the following call, but currently
        // it depends on DashView which is defined outside of the QML file we are testing
        // dash_selector.adremove()

    }
}

}