tst_editorwidgets.qml 742 B

12345678910111213141516171819202122232425262728293031323334
  1. import QtQuick 2.3
  2. import QtTest 1.0
  3. import QFieldControls 1.0
  4. TestCase {
  5. name: "QFieldTests"
  6. TextEdit {
  7. id: textEdit
  8. property var value: 'one'
  9. property var config: undefined
  10. property bool isEnabled: true
  11. }
  12. Range {
  13. id: range
  14. property var value: 1
  15. property var config: undefined
  16. property bool isEnabled: true
  17. }
  18. function test_textEdit() {
  19. compare(textEdit.children[1].text, 'one')
  20. textEdit.value = 'two'
  21. compare(textEdit.children[1].text, 'two')
  22. }
  23. function test_range() {
  24. compare(range.children[0].children[0].text, '1')
  25. range.value = 2
  26. compare(range.children[0].children[0].text, '2')
  27. }
  28. }