]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: migrate guards transitions
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 9 Jun 2022 14:03:48 +0000 (16:03 +0200)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Thu, 30 Jun 2022 07:59:00 +0000 (09:59 +0200)
packages/router/e2e/specs/multi-app.js
packages/router/e2e/specs/transitions.js [moved from packages/router/old-e2e/specs/transitions.js with 59% similarity]
packages/router/e2e/transitions/index.html [moved from packages/router/old-e2e/transitions/index.html with 100% similarity]
packages/router/e2e/transitions/index.ts [moved from packages/router/old-e2e/transitions/index.ts with 100% similarity]

index 6be9197e9bf210cb4eb1b8dfa479beabea0e6b4f..81e2755d7b4c74314f21cc5b9dc5e874d4893416 100644 (file)
@@ -21,34 +21,16 @@ module.exports = {
 
       // they should all be displaying the home page
       .assert.textContains('#app-1 .home', 'Home')
-      .assert.cssClassPresent(
-        '#app-1 li:nth-child(1) a',
-        'router-link-exact-active'
-      )
-      .assert.not.cssClassPresent(
-        '#app-1 li:nth-child(2) a',
-        'router-link-active'
-      )
+      .assert.hasClass('#app-1 li:nth-child(1) a', 'router-link-exact-active')
+      .assert.not.hasClass('#app-1 li:nth-child(2) a', 'router-link-active')
 
       .assert.textContains('#app-2 .home', 'Home')
-      .assert.cssClassPresent(
-        '#app-2 li:nth-child(1) a',
-        'router-link-exact-active'
-      )
-      .assert.not.cssClassPresent(
-        '#app-2 li:nth-child(2) a',
-        'router-link-active'
-      )
+      .assert.hasClass('#app-2 li:nth-child(1) a', 'router-link-exact-active')
+      .assert.not.hasClass('#app-2 li:nth-child(2) a', 'router-link-active')
 
       .assert.textContains('#app-3 .home', 'Home')
-      .assert.cssClassPresent(
-        '#app-3 li:nth-child(1) a',
-        'router-link-exact-active'
-      )
-      .assert.not.cssClassPresent(
-        '#app-3 li:nth-child(2) a',
-        'router-link-active'
-      )
+      .assert.hasClass('#app-3 li:nth-child(1) a', 'router-link-exact-active')
+      .assert.not.hasClass('#app-3 li:nth-child(2) a', 'router-link-active')
 
       // navigation on app 1
       .click('#app-1 li:nth-child(2) a')
similarity index 59%
rename from packages/router/old-e2e/specs/transitions.js
rename to packages/router/e2e/specs/transitions.js
index 11c597fb59b27132c2d6c7e700dfe6ade062c75b..d480fac9c54718ccf371fe34734617c7c47abed7 100644 (file)
@@ -9,41 +9,38 @@ module.exports = {
       .waitForElementPresent('#app > *', 1000)
 
       .click('li:nth-child(2) a')
-      .assert.cssClassPresent('.view.home', 'fade-leave-active')
+      .assert.hasClass('.view.home', 'fade-leave-active')
       .waitForElementPresent('.view.parent', TIMEOUT)
-      .assert.cssClassPresent('.view.parent', 'fade-enter-active')
-      .assert.not.cssClassPresent(
-        '.child-view.default',
-        'slide-left-enter-active'
-      )
+      .assert.hasClass('.view.parent', 'fade-enter-active')
+      .assert.not.hasClass('.child-view.default', 'slide-left-enter-active')
       .waitForElementNotPresent('.view.parent.fade-enter-active', TIMEOUT)
 
       .click('li:nth-child(3) a')
-      .assert.cssClassPresent('.child-view.default', 'slide-left-leave-active')
-      .assert.cssClassPresent('.child-view.foo', 'slide-left-enter-active')
+      .assert.hasClass('.child-view.default', 'slide-left-leave-active')
+      .assert.hasClass('.child-view.foo', 'slide-left-enter-active')
       .waitForElementNotPresent('.child-view.default', TIMEOUT)
 
       .click('li:nth-child(4) a')
-      .assert.cssClassPresent('.child-view.foo', 'slide-left-leave-active')
-      .assert.cssClassPresent('.child-view.bar', 'slide-left-enter-active')
+      .assert.hasClass('.child-view.foo', 'slide-left-leave-active')
+      .assert.hasClass('.child-view.bar', 'slide-left-enter-active')
       .waitForElementNotPresent('.child-view.foo', TIMEOUT)
 
       .click('li:nth-child(2) a')
-      .assert.cssClassPresent('.child-view.bar', 'slide-right-leave-active')
-      .assert.cssClassPresent('.child-view.default', 'slide-right-enter-active')
+      .assert.hasClass('.child-view.bar', 'slide-right-leave-active')
+      .assert.hasClass('.child-view.default', 'slide-right-enter-active')
       .waitForElementNotPresent('.child-view.bar', TIMEOUT)
 
       .click('li:nth-child(1) a')
-      .assert.cssClassPresent('.view.parent', 'fade-leave-active')
+      .assert.hasClass('.view.parent', 'fade-leave-active')
       .waitForElementPresent('.view.home', TIMEOUT)
-      .assert.cssClassPresent('.view.home', 'fade-enter-active')
+      .assert.hasClass('.view.home', 'fade-enter-active')
       .waitForElementNotPresent('.view.home.fade-enter-active', TIMEOUT)
 
       .click('li:nth-child(5) a')
-      .assert.cssClassPresent('.view.home', 'fade-leave-active')
+      .assert.hasClass('.view.home', 'fade-leave-active')
       .waitForElementNotPresent('.view.home', TIMEOUT)
       .click('li:nth-child(2) a')
-      .assert.cssClassPresent('.view.parent', 'fade-enter-active')
+      .assert.hasClass('.view.parent', 'fade-enter-active')
 
       .end()
   },