Icu 12567 add new field credential mapping overrides (#2156)
* chore: 🤖 add credential type select list
This commit is contained in:
1 parent
956f6fd04d
commit
93c8d481fd
14 files changed
+517
-36
No files matched your search
@@ -163,4 +163,65 @@ module('Integration | Component | list-wrapper', function (hooks) {
|
||||
await click('.list-wrapper-field [data-test-remove-option-button=option1]');
|
||||
assert.dom('tbody tr').exists({ count: 3 });
|
||||
});
|
||||
|
||||
test('it renders multiple options with select and text input as key value pair', async function (assert) {
|
||||
this.options = {
|
||||
username_attribute: 'user',
|
||||
password_attribute: 'pass',
|
||||
};
|
||||
|
||||
this.selectOptions = {
|
||||
username_attribute: 'User Key',
|
||||
password_attribute: 'Pass Key',
|
||||
};
|
||||
await render(hbs`
|
||||
<Form::Field::ListWrapper>
|
||||
<:field as |F|>
|
||||
<F.SelectText @name="credential_mapping_overrides" @options={{this.options}} @removeDuplicates='true' @selectOptions={{this.selectOptions}}></F.SelectText>
|
||||
</:field>
|
||||
</Form::Field::ListWrapper>
|
||||
`);
|
||||
|
||||
assert.dom('tbody tr').exists({ count: 2 });
|
||||
assert
|
||||
.dom('.list-wrapper-field tbody tr:last-child input')
|
||||
.hasValue('pass');
|
||||
assert
|
||||
.dom('.list-wrapper-field tbody tr:last-child select')
|
||||
.hasValue('password_attribute');
|
||||
});
|
||||
|
||||
test('it does not render new rows when the select option limit is reached by passing in @removeDuplicates', async function (assert) {
|
||||
this.options = { username_attribute: 'user', password_attribute: 'pass' };
|
||||
this.selectOptions = {
|
||||
username_attribute: 'User Key',
|
||||
password_attribute: 'Pass Key',
|
||||
};
|
||||
await render(hbs`
|
||||
<Form::Field::ListWrapper>
|
||||
<:field as |F|>
|
||||
<F.SelectText @name="credential_mapping_overrides" @options={{this.options}} @selectOptions={{this.selectOptions}} @removeDuplicates='true'></F.SelectText>
|
||||
</:field>
|
||||
</Form::Field::ListWrapper>
|
||||
`);
|
||||
|
||||
assert.dom('tbody tr').exists({ count: 2 });
|
||||
});
|
||||
|
||||
test('it does render unlimited new rows when @removeDuplicates is not passed', async function (assert) {
|
||||
this.options = { username_attribute: 'user', password_attribute: 'pass' };
|
||||
this.selectOptions = {
|
||||
username_attribute: 'User Key',
|
||||
password_attribute: 'Pass Key',
|
||||
};
|
||||
await render(hbs`
|
||||
<Form::Field::ListWrapper>
|
||||
<:field as |F|>
|
||||
<F.SelectText @name="credential_mapping_overrides" @options={{this.options}} @selectOptions={{this.selectOptions}}></F.SelectText>
|
||||
</:field>
|
||||
</Form::Field::ListWrapper>
|
||||
`);
|
||||
|
||||
assert.dom('tbody tr').exists({ count: 3 });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user