chore: 🤖 add skip prompts toggle (#2036)
* chore: 🤖 add skip prompts toggle
This commit is contained in:
1 parent
77f8235ebf
commit
751b5bef78
7 files changed
+83
-28
No files matched your search
@@ -43,6 +43,7 @@ module('Acceptance | auth-methods | create', function (hooks) {
|
||||
|
||||
const CLAIMS_SCOPES_BTN_SELECTOR = '[name="claims_scopes"] button';
|
||||
const CLAIMS_SCOPES_INPUT_SELECTOR = '[name="claims_scopes"] input';
|
||||
const TOGGLE_SELECTOR = '[name="prompts"]';
|
||||
let getAuthMethodsCount;
|
||||
let featuresService;
|
||||
|
||||
@@ -108,7 +109,7 @@ module('Acceptance | auth-methods | create', function (hooks) {
|
||||
});
|
||||
|
||||
test('Users can create new oidc auth method', async function (assert) {
|
||||
assert.expect(13);
|
||||
assert.expect(14);
|
||||
const count = getAuthMethodsCount();
|
||||
|
||||
await visit(`${urls.authMethods}/new?type=oidc`);
|
||||
@@ -135,6 +136,10 @@ module('Acceptance | auth-methods | create', function (hooks) {
|
||||
await fillIn('[name="max_age"]', '5');
|
||||
await fillIn('[name="api_url_prefix"]', 'api_url_prefix');
|
||||
await click('[id="consent"]', 'consent');
|
||||
|
||||
//If skip prompts toggle is clicked, then we hide the rest of the prompt options
|
||||
await click(TOGGLE_SELECTOR);
|
||||
assert.dom('[id="select_account"]').isNotVisible();
|
||||
await click(SAVE_BTN_SELECTOR);
|
||||
|
||||
assert.strictEqual(getAuthMethodsCount(), count + 1);
|
||||
@@ -154,7 +159,7 @@ module('Acceptance | auth-methods | create', function (hooks) {
|
||||
assert.deepEqual(authMethod.attributes.idp_ca_certs, ['certificates']);
|
||||
assert.strictEqual(authMethod.attributes.max_age, 5);
|
||||
assert.strictEqual(authMethod.attributes.api_url_prefix, 'api_url_prefix');
|
||||
assert.deepEqual(authMethod.attributes.prompts, ['consent']);
|
||||
assert.deepEqual(authMethod.attributes.prompts, ['none']);
|
||||
});
|
||||
|
||||
test('Users can create a new ldap auth method', async function (assert) {
|
||||
|
||||
@@ -51,6 +51,8 @@ module('Acceptance | auth-methods | update', function (hooks) {
|
||||
'[name="claims_scopes"] [data-test-remove-button]';
|
||||
const CLAIMS_SCOPES_BTN_SELECTOR = '[name="claims_scopes"] button';
|
||||
const CLAIMS_SCOPES_INPUT_SELECTOR = '[name="claims_scopes"] input';
|
||||
const TOGGLE_SELECTOR = '[name="prompts"]';
|
||||
|
||||
const instances = {
|
||||
scopes: {
|
||||
global: null,
|
||||
@@ -173,7 +175,7 @@ module('Acceptance | auth-methods | update', function (hooks) {
|
||||
await click(IDP_CERTS_BTN_SELECTOR);
|
||||
await fillIn('[name="max_age"]', '5');
|
||||
await fillIn('[name="api_url_prefix"]', 'api_url_prefix');
|
||||
await click('[id="none"]', 'none');
|
||||
await click(TOGGLE_SELECTOR);
|
||||
await click('form [type="submit"]:not(:disabled)');
|
||||
|
||||
const authMethod = this.server.schema.authMethods.findBy({ name });
|
||||
@@ -192,7 +194,7 @@ module('Acceptance | auth-methods | update', function (hooks) {
|
||||
assert.deepEqual(authMethod.attributes.idp_ca_certs, ['certificates']);
|
||||
assert.strictEqual(authMethod.attributes.max_age, 5);
|
||||
assert.strictEqual(authMethod.attributes.api_url_prefix, 'api_url_prefix');
|
||||
assert.deepEqual(authMethod.attributes.prompts, ['consent', 'none']);
|
||||
assert.deepEqual(authMethod.attributes.prompts, ['none']);
|
||||
});
|
||||
|
||||
test('can update an ldap auth method and save changes', async function (assert) {
|
||||
|
||||
Reference in new issue
Block a user