Bug Fix for Kymgmt keyType on default (#17407)

* the fix

* add test coverage

* changelog

* removes comment
This commit is contained in:
Angel Garbarino 2022-10-04 12:14:25 -07:00 committed by GitHub
parent 805843beaa
commit 345c65ff04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

3
changelog/17407.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui/keymgmt: Sets the defaultValue for type when creating a key.
```

View File

@ -24,6 +24,7 @@ export default class KeymgmtKeyModel extends Model {
@attr('string', {
subText: 'The type of cryptographic key that will be created.',
possibleValues: KEY_TYPES,
defaultValue: 'rsa-2048',
})
type;

View File

@ -75,4 +75,13 @@ module('Integration | Component | keymgmt/key-edit', function (hooks) {
assert.dom('[data-test-tab="Details"]').doesNotExist('Details tab does not exist');
assert.dom('[data-test-tab="Versions"]').doesNotExist('Versions tab does not exist');
});
test('it defaults to keyType rsa-2048', async function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
this.model = store.createRecord('keymgmt/key');
this.set('mode', 'create');
await render(hbs`<Keymgmt::KeyEdit @model={{model}} @mode={{mode}} /><div id="modal-wormhole" />`);
assert.dom('[data-test-input="type"]').hasValue('rsa-2048', 'Has type rsa-2048 by default');
});
});