From: Eduardo San Martin Morote Date: Thu, 9 Jun 2022 14:03:48 +0000 (+0200) Subject: test: migrate guards transitions X-Git-Tag: v4.1.0~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00da873ffe3c6c426633474e6857605c964eb086;p=thirdparty%2Fvuejs%2Frouter.git test: migrate guards transitions --- diff --git a/packages/router/e2e/specs/multi-app.js b/packages/router/e2e/specs/multi-app.js index 6be9197e..81e2755d 100644 --- a/packages/router/e2e/specs/multi-app.js +++ b/packages/router/e2e/specs/multi-app.js @@ -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') diff --git a/packages/router/old-e2e/specs/transitions.js b/packages/router/e2e/specs/transitions.js similarity index 59% rename from packages/router/old-e2e/specs/transitions.js rename to packages/router/e2e/specs/transitions.js index 11c597fb..d480fac9 100644 --- a/packages/router/old-e2e/specs/transitions.js +++ b/packages/router/e2e/specs/transitions.js @@ -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() }, diff --git a/packages/router/old-e2e/transitions/index.html b/packages/router/e2e/transitions/index.html similarity index 100% rename from packages/router/old-e2e/transitions/index.html rename to packages/router/e2e/transitions/index.html diff --git a/packages/router/old-e2e/transitions/index.ts b/packages/router/e2e/transitions/index.ts similarity index 100% rename from packages/router/old-e2e/transitions/index.ts rename to packages/router/e2e/transitions/index.ts