Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

89 lignes
1.8 KiB

  1. context("Control Float", () => {
  2. before(() => {
  3. cy.login();
  4. cy.visit("/app/website");
  5. });
  6. function get_dialog_with_float() {
  7. return cy.dialog({
  8. title: "Float Check",
  9. fields: [
  10. {
  11. fieldname: "float_number",
  12. fieldtype: "Float",
  13. Label: "Float",
  14. },
  15. ],
  16. });
  17. }
  18. it("check value changes", () => {
  19. get_dialog_with_float().as("dialog");
  20. let data = get_data();
  21. data.forEach((x) => {
  22. cy.window()
  23. .its("influxframework")
  24. .then((influxframework) => {
  25. influxframework.boot.sysdefaults.number_format = x.number_format;
  26. });
  27. x.values.forEach((d) => {
  28. cy.get_field("float_number", "Float").clear();
  29. cy.wait(200);
  30. cy.fill_field("float_number", d.input, "Float").blur();
  31. cy.get_field("float_number", "Float").should("have.value", d.blur_expected);
  32. cy.get_field("float_number", "Float").focus();
  33. cy.get_field("float_number", "Float").blur();
  34. cy.get_field("float_number", "Float").focus();
  35. cy.get_field("float_number", "Float").should("have.value", d.focus_expected);
  36. });
  37. });
  38. });
  39. function get_data() {
  40. return [
  41. {
  42. number_format: "#.###,##",
  43. values: [
  44. {
  45. input: "364.87,334",
  46. blur_expected: "36.487,334",
  47. focus_expected: "36487.334",
  48. },
  49. {
  50. input: "36487,334",
  51. blur_expected: "36.487,334",
  52. focus_expected: "36487.334",
  53. },
  54. {
  55. input: "100",
  56. blur_expected: "100,000",
  57. focus_expected: "100",
  58. },
  59. ],
  60. },
  61. {
  62. number_format: "#,###.##",
  63. values: [
  64. {
  65. input: "364,87.334",
  66. blur_expected: "36,487.334",
  67. focus_expected: "36487.334",
  68. },
  69. {
  70. input: "36487.334",
  71. blur_expected: "36,487.334",
  72. focus_expected: "36487.334",
  73. },
  74. {
  75. input: "100",
  76. blur_expected: "100.000",
  77. focus_expected: "100",
  78. },
  79. ],
  80. },
  81. ];
  82. }
  83. });