vault/ui/tests/acceptance/auth-test.js
2018-04-03 09:16:57 -05:00

28 lines
761 B
JavaScript

import { test } from 'qunit';
import moduleForAcceptance from 'vault/tests/helpers/module-for-acceptance';
import { supportedAuthBackends } from 'vault/helpers/supported-auth-backends';
moduleForAcceptance('Acceptance | auth', {
afterEach() {
return authLogout();
},
});
test('auth query params', function(assert) {
const backends = supportedAuthBackends();
visit('/vault/auth');
andThen(function() {
assert.equal(currentURL(), '/vault/auth');
});
backends.reverse().forEach(backend => {
click(`[data-test-auth-method-link="${backend.type}"]`);
andThen(function() {
assert.equal(
currentURL(),
`/vault/auth?with=${backend.type}`,
`has the correct URL for ${backend.type}`
);
});
});
});