]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test(e2e): add todos
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 7 May 2020 10:04:51 +0000 (12:04 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 7 May 2020 10:04:51 +0000 (12:04 +0200)
e2e/specs/multi-app.js

index f03f62daf5e01b65feea7777c250e8328d5178b4..fe251ed49e44982cd62c869b0a6a7fbb4d531bd7 100644 (file)
@@ -56,16 +56,29 @@ module.exports = {
 
       // navigation on app 1
       .click('#app-1 li:nth-child(2) a')
+      .assert.containsText('#guardcount', '2')
       .assert.containsText('#app-1 .user', 'User 1')
       .assert.containsText('#app-2 .user', 'User 1')
       .assert.containsText('#app-3 .user', 'User 1')
 
       // navigation on app 2
       .click('#app-2 li:nth-child(3) a')
+      .assert.containsText('#guardcount', '3')
       .assert.containsText('#app-1 .user', 'User 2')
       .assert.containsText('#app-2 .user', 'User 2')
       .assert.containsText('#app-3 .user', 'User 2')
 
+      // should trigger the guard only once
+      .back()
+      .assert.containsText('#guardcount', '4')
+
+      /**
+       * TODO:
+       * - add in-component guards and check each one of them is called
+       * - check `this` is the actual instance by injecting a global property
+       *   per app equal to their id and using it somewhere in the template
+       */
+
       // unmounting apps should end up removing the popstate listener
       // .click('#unmount1')
       // .click('#unmount2')