From 87e1fd363e12eccefcee1bd17ffd218d63e8c499 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sat, 3 Oct 2020 12:57:21 -0400 Subject: [PATCH] chore: add unauthenticated redirect test --- ui/core/tests/acceptance/authentication-test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/core/tests/acceptance/authentication-test.js b/ui/core/tests/acceptance/authentication-test.js index 113a78c07..d8bdb6162 100644 --- a/ui/core/tests/acceptance/authentication-test.js +++ b/ui/core/tests/acceptance/authentication-test.js @@ -37,6 +37,7 @@ module('Acceptance | authentication', function (hooks) { let authenticateURL; let authMethodAuthenticateURL; let authMethodGlobalAuthenticateURL; + let changePasswordURL; let orgsURL; let projectsURL; let usersURL; @@ -70,6 +71,7 @@ module('Acceptance | authentication', function (hooks) { authenticateURL = `/scopes/${orgScopeID}/authenticate`; authMethodGlobalAuthenticateURL = `/scopes/global/authenticate/${globalAuthMethodID}`; authMethodAuthenticateURL = `/scopes/${orgScopeID}/authenticate/${authMethodID}`; + changePasswordURL = `/account/change-password`; orgsURL = `/scopes/global/orgs`; projectsURL = `/scopes/${orgScopeID}/projects`; usersURL = `/scopes/${orgScopeID}/users`; @@ -113,6 +115,13 @@ module('Acceptance | authentication', function (hooks) { assert.notOk(currentSession().isAuthenticated); }); + test('visiting change password while unauthenticated redirects to first global authenticate method', async function (assert) { + assert.expect(2); + await visit(changePasswordURL); + assert.equal(currentURL(), authMethodGlobalAuthenticateURL); + assert.notOk(currentSession().isAuthenticated); + }); + test('visiting orgs while unauthenticated redirects to first global authenticate method', async function (assert) { assert.expect(2); await visit(orgsURL);