Browse Source

add tab && shift+tab

Tienson Qin 4 years ago
parent
commit
e617fd29d6
4 changed files with 21 additions and 1 deletions
  1. 13 1
      cypress/integration/app/window.cljs
  2. 2 0
      cypress/support/index.js
  3. 1 0
      package.json
  4. 5 0
      yarn.lock

+ 13 - 1
cypress/integration/app/window.cljs

@@ -18,6 +18,13 @@
       (click)
       (click)
       (type content)))
       (type content)))
 
 
+(defn tab
+  []
+  (.. cy (realPress "Tab")))
+
+(defn shift+tab
+  []
+  (.. cy (realPress #js ["Shift" "Tab"])))
 
 
 (describe "Window"
 (describe "Window"
   (beforeEach []
   (beforeEach []
@@ -49,4 +56,9 @@
 
 
     ;; edit bullet
     ;; edit bullet
     (edit-block "this is my first bullet {enter}")
     (edit-block "this is my first bullet {enter}")
-    (edit-block "this is my second bullet {enter}")))
+    (edit-block "this is my second bullet {enter}")
+    (edit-block "this is my third bullet")
+    (tab)
+    (edit-block ", continue editing")
+    (shift+tab)
+    (edit-block ", continue {enter}")))

+ 2 - 0
cypress/support/index.js

@@ -18,3 +18,5 @@ import './commands'
 
 
 // Alternatively you can use CommonJS syntax:
 // Alternatively you can use CommonJS syntax:
 // require('./commands')
 // require('./commands')
+
+import "cypress-real-events/support";

+ 1 - 0
package.json

@@ -68,6 +68,7 @@
         "chrono-node": "^2.2.4",
         "chrono-node": "^2.2.4",
         "codemirror": "^5.58.1",
         "codemirror": "^5.58.1",
         "cypress-clojurescript-preprocessor": "^0.1.4",
         "cypress-clojurescript-preprocessor": "^0.1.4",
+        "cypress-real-events": "^1.5.0",
         "diff": "5.0.0",
         "diff": "5.0.0",
         "diff-match-patch": "^1.0.5",
         "diff-match-patch": "^1.0.5",
         "electron": "^13.0.0",
         "electron": "^13.0.0",

+ 5 - 0
yarn.lock

@@ -2907,6 +2907,11 @@ cypress-clojurescript-preprocessor@^0.1.4:
     chokidar "3.4.0"
     chokidar "3.4.0"
     shadow-cljs "2.10.18"
     shadow-cljs "2.10.18"
 
 
+cypress-real-events@^1.5.0:
+  version "1.5.0"
+  resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.5.0.tgz#115945872f3e39b90f6896a5a226ff4effa1b8f5"
+  integrity sha512-5virdYmZmtnpVqX4U0Ht66985b5MpCHE6icDXReQGognja5d2FuRD+Hh2MqzJqOTmai74z50u5+nmTZ/Dn/VcQ==
+
 cypress@^7.5.0:
 cypress@^7.5.0:
   version "7.5.0"
   version "7.5.0"
   resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.5.0.tgz#72dd342e3b45f54b63cd46819f38d126feff5954"
   resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.5.0.tgz#72dd342e3b45f54b63cd46819f38d126feff5954"