util.cljs 714 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. (ns app.util
  2. (:refer-clojure :exclude [first get]))
  3. (def cy js/cy)
  4. (defn back-to-home
  5. []
  6. (.. cy (get ".ui__modal")
  7. (first)
  8. (click)))
  9. (defn edit-block
  10. [content]
  11. (.. cy (get "textarea")
  12. (first)
  13. (click)
  14. (type content)))
  15. (defn tab
  16. []
  17. (.. cy (realPress "Tab")))
  18. (defn shift+tab
  19. []
  20. (.. cy (realPress #js ["Shift" "Tab"])))
  21. (defn shift+up
  22. []
  23. (.. cy (realPress #js ["Shift" "ArrowUp"])))
  24. (defn shift+down
  25. []
  26. (.. cy (realPress #js ["Shift" "ArrowDown"])))
  27. (defn backspace
  28. []
  29. (edit-block "{backspace}"))
  30. (defn delete
  31. []
  32. (.. cy (realPress "Delete")))
  33. (defn match-content
  34. [value]
  35. (.. cy (get "textarea") (first)
  36. (should "have.value" value)))