Skip to content

Commit

Permalink
Add test covering for PositioningInformationModel
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenD98 authored Oct 12, 2024
1 parent 7ae9dd1 commit 657ef5f
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/qml/tst_positioning.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ TestCase {
}
}

Repeater {
id: positioningInformations
model: PositioningInformationModel {
distanceUnits: qgisProject.distanceUnits
positioningSource: positioning
}
delegate: Item {
property string name: Name
property string value: Value
}
}

FeatureModel {
id: featureModel
project: qgisProject
Expand Down Expand Up @@ -160,5 +172,39 @@ TestCase {
wait(2500);
compare(positioning.positionInformation.qualityDescription, "Fixed RTK + IMU");
compare(positioning.positionInformation.imuCorrection, true);

// Expected values for positioningInformations
const expectedPositioningInformationsValues = [{
"name": "H. Accuracy",
"value": "0.006 m"
}, {
"name": "V. Accuracy",
"value": "0.016 m"
}, {
"name": "PDOP",
"value": "1.5"
}, {
"name": "HDOP",
"value": "0.9"
}, {
"name": "VDOP",
"value": "1.2"
}, {
"name": "Valid",
"value": "True"
}, {
"name": "Fix",
"value": "Fix3D"
}, {
"name": "Quality",
"value": "Fixed RTK + IMU"
}];

// we are skipping "4" items ["X","Y","Altitude","Speed"] because they might move a bit.
compare(positioningInformations.count, expectedPositioningInformationsValues.length + 4);
expectedPositioningInformationsValues.forEach((expected, index) => {
compare(positioningInformations.itemAt(index + 4).name, expected.name);
compare(positioningInformations.itemAt(index + 4).value, expected.value);
});
}
}

1 comment on commit 657ef5f

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.