From 345c65ff04e0db58058fa11376330c94b367fa70 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Tue, 4 Oct 2022 12:14:25 -0700 Subject: [PATCH] Bug Fix for Kymgmt keyType on default (#17407) * the fix * add test coverage * changelog * removes comment --- changelog/17407.txt | 3 +++ ui/app/models/keymgmt/key.js | 1 + ui/tests/integration/components/keymgmt/key-edit-test.js | 9 +++++++++ 3 files changed, 13 insertions(+) create mode 100644 changelog/17407.txt diff --git a/changelog/17407.txt b/changelog/17407.txt new file mode 100644 index 000000000..b0e5ae41c --- /dev/null +++ b/changelog/17407.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui/keymgmt: Sets the defaultValue for type when creating a key. +``` diff --git a/ui/app/models/keymgmt/key.js b/ui/app/models/keymgmt/key.js index e88c5ff70..ff570c215 100644 --- a/ui/app/models/keymgmt/key.js +++ b/ui/app/models/keymgmt/key.js @@ -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; diff --git a/ui/tests/integration/components/keymgmt/key-edit-test.js b/ui/tests/integration/components/keymgmt/key-edit-test.js index b70101a18..0d67fffdf 100644 --- a/ui/tests/integration/components/keymgmt/key-edit-test.js +++ b/ui/tests/integration/components/keymgmt/key-edit-test.js @@ -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`