numeric_filter.json 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [
  2. {
  3. "desc": "Numeric format should still return a string if field isn't allowed",
  4. "query": "random_field:>500",
  5. "result": [
  6. {"type": "spaces", "value": ""},
  7. {
  8. "type": "filter",
  9. "filter": "text",
  10. "negated": false,
  11. "key": {"type": "keySimple", "value": "random_field", "quoted": false},
  12. "operator": "",
  13. "value": {"type": "valueText", "value": ">500", "quoted": false}
  14. },
  15. {"type": "spaces", "value": ""}
  16. ]
  17. },
  18. {
  19. "desc": "Numeric format should not negate operator if field isn't allowed",
  20. "query": "!random_field:>500",
  21. "result": [
  22. {"type": "spaces", "value": ""},
  23. {
  24. "type": "filter",
  25. "filter": "text",
  26. "negated": true,
  27. "key": {"type": "keySimple", "value": "random_field", "quoted": false},
  28. "operator": "",
  29. "value": {"type": "valueText", "value": ">500", "quoted": false}
  30. },
  31. {"type": "spaces", "value": ""}
  32. ]
  33. },
  34. {
  35. "query": "!random_field:500",
  36. "result": [
  37. {"type": "spaces", "value": ""},
  38. {
  39. "type": "filter",
  40. "filter": "text",
  41. "negated": true,
  42. "key": {"type": "keySimple", "value": "random_field", "quoted": false},
  43. "operator": "",
  44. "value": {"type": "valueText", "value": "500", "quoted": false}
  45. },
  46. {"type": "spaces", "value": ""}
  47. ]
  48. },
  49. {
  50. "query": "project_id:-500",
  51. "result": [
  52. {"type": "spaces", "value": ""},
  53. {
  54. "type": "filter",
  55. "filter": "numeric",
  56. "negated": false,
  57. "key": {"type": "keySimple", "value": "project_id", "quoted": false},
  58. "operator": "",
  59. "value": {"type": "valueNumber", "value": "-500", "rawValue": -500, "unit": null}
  60. },
  61. {"type": "spaces", "value": ""}
  62. ]
  63. },
  64. {
  65. "query": "!issue.id:500",
  66. "result": [
  67. {"type": "spaces", "value": ""},
  68. {
  69. "type": "filter",
  70. "filter": "numeric",
  71. "negated": true,
  72. "key": {"type": "keySimple", "value": "issue.id", "quoted": false},
  73. "operator": "",
  74. "value": {"type": "valueNumber", "value": "500", "rawValue": 500, "unit": null}
  75. },
  76. {"type": "spaces", "value": ""}
  77. ]
  78. },
  79. {
  80. "query": "issue.id:<500",
  81. "result": [
  82. {"type": "spaces", "value": ""},
  83. {
  84. "type": "filter",
  85. "filter": "numeric",
  86. "negated": false,
  87. "key": {"type": "keySimple", "value": "issue.id", "quoted": false},
  88. "operator": "<",
  89. "value": {"type": "valueNumber", "value": "500", "rawValue": 500, "unit": null}
  90. },
  91. {"type": "spaces", "value": ""}
  92. ]
  93. }
  94. ]