|
6 | 6 | import { module, test } from 'qunit'; |
7 | 7 | import { setupApplicationTest } from 'ember-qunit'; |
8 | 8 | import { click, currentURL, visit, waitUntil, find, fillIn } from '@ember/test-helpers'; |
9 | | -import { allSupportedAuthBackends, supportedAuthBackends } from 'vault/helpers/supported-auth-backends'; |
10 | 9 | import { setupMirage } from 'ember-cli-mirage/test-support'; |
| 10 | +import { allSupportedAuthBackends, supportedAuthBackends } from 'vault/helpers/supported-auth-backends'; |
| 11 | +import VAULT_KEYS from 'vault/tests/helpers/vault-keys'; |
11 | 12 |
|
12 | 13 | const AUTH_FORM = { |
13 | 14 | method: '[data-test-select=auth-method]', |
14 | 15 | token: '[data-test-token]', |
15 | 16 | login: '[data-test-auth-submit]', |
16 | 17 | }; |
17 | 18 | const ENT_AUTH_METHODS = ['saml']; |
| 19 | +const { rootToken } = VAULT_KEYS; |
18 | 20 |
|
19 | 21 | module('Acceptance | auth', function (hooks) { |
20 | 22 | setupApplicationTest(hooks); |
@@ -193,4 +195,17 @@ module('Acceptance | auth', function (hooks) { |
193 | 195 | await fillIn(AUTH_FORM.method, 'token'); |
194 | 196 | await click('[data-test-auth-submit]'); |
195 | 197 | }); |
| 198 | + |
| 199 | + test('it does not call renew-self after successful login with non-renewable token', async function (assert) { |
| 200 | + this.server.post( |
| 201 | + '/auth/token/renew-self', |
| 202 | + () => new Error('should not call renew-self directly after logging in') |
| 203 | + ); |
| 204 | + |
| 205 | + await visit('/vault/auth'); |
| 206 | + await fillIn(AUTH_FORM.method, 'token'); |
| 207 | + await fillIn(AUTH_FORM.token, rootToken); |
| 208 | + await click('[data-test-auth-submit]'); |
| 209 | + assert.strictEqual(currentURL(), '/vault/dashboard'); |
| 210 | + }); |
196 | 211 | }); |
0 commit comments